Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Internet problems after emerge update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Wed Dec 26, 2012 1:19 am    Post subject: Internet problems after emerge update Reply with quote

Since updating my system many of my applications cannot use the Internet. Examples include w3m, getmail and youtube-dl. Interestingly ping and seamonkey still work. Below I have listed some sample error messages.

w3m:
Code:
Can't load http://www.amazon.co.uk/


getmail:
Code:
socket error ([Errno 2] No such file or directory)


youtube-dl:
Code:
WARNING: unable to set language: <urlopen error [Errno 2] No such file or directory>
ERROR: unable to download video webpage: <urlopen error [Errno 11] Resource temporarily unavailable>


Instinctively I suspect some networking library has broken on my system. Despite this revdep-rebuild has shown up no problems.

Sudo makes no difference thus permissions are not the issue here. Troubleshooting this issue has proved beyond me. I humbly request help from anyone willing to give it.
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8925

PostPosted: Wed Dec 26, 2012 4:01 am    Post subject: Reply with quote

Are the affected applications unable to use the Internet or unable to use DNS?
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Wed Dec 26, 2012 10:32 am    Post subject: Reply with quote

DNS apparently. I am basing this on the fact w3m can access web pages if I use their IP address.
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1324
Location: /uk/sheffield

PostPosted: Wed Dec 26, 2012 10:47 am    Post subject: Reply with quote

What is the contents of /etc/resolv.conf ?

This file holds details for DNS, if its not pointing to a valid DNS server then you won't be able to resolve domain names.

If you've a local network the contents of this may simply be that of your router, if thats the case then check that the router is configured with valid DNS serves. These are usually provided by your ISP, but you can always add secondary (and sometimes tertiary) DNS serves so Google's 4.4.4.4 and 8.8.8.8 are good, simple options.
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Wed Dec 26, 2012 11:21 am    Post subject: Reply with quote

Resolv.conf:
Code:

# Generated by dhcpcd from wlan0
# /etc/resolv.conf.head can replace this line
domain <censored>
nameserver <censored>
# /etc/resolv.conf.tail can replace this line


I use my router's IP address as the name server. I know this works, because it has done so for a long time. Furthermore substituting in 4.4.4.4 did not fix the problem.
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Fri Dec 28, 2012 9:42 am    Post subject: Reply with quote

Anyone?
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8925

PostPosted: Fri Dec 28, 2012 10:51 pm    Post subject: Reply with quote

What is the output of dig hostname @<censored>; dig hostname @4.4.4.4?
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1324
Location: /uk/sheffield

PostPosted: Sat Dec 29, 2012 9:21 am    Post subject: Reply with quote

Well whilst your computer is pointing to your router correctly, have you...


slack---line wrote:
check that the router is configured with valid DNS servers. These are usually provided by your ISP, but you can always add secondary (and sometimes tertiary) DNS serves so Google's 4.4.4.4 and 8.8.8.8 are good, simple options.



You say you substituted in 4.4.4.4, but as written its ambiguous and it sounds as though you did this on your computer rather than your router perhaps (although of course you may have meant you tried it on your router, but thats not clear from how you've written it).
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Sat Dec 29, 2012 12:49 pm    Post subject: Reply with quote

Hu wrote:
What is the output of dig hostname @<censored>; dig hostname @4.4.4.4?

dig hostname @<censored>:
Code:


; <<>> DiG 9.9.2 <<>> hostname @<censored>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 54598
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;hostname.         IN   A

;; AUTHORITY SECTION:
.         10716   IN   SOA   a.root-servers.net. nstld.verisign-grs.com. 2012122900 1800 900 604800 86400

;; Query time: 16 msec
;; SERVER: <censored>#53(<censored>)
;; WHEN: Sat Dec 29 12:37:31 2012
;; MSG SIZE  rcvd: 112


dig hostname @4.4.4.4:
Code:


; <<>> DiG 9.9.2 <<>> hostname @4.4.4.4
;; global options: +cmd
;; connection timed out; no servers could be reached


slack---line wrote:
Well whilst your computer is pointing to your router
correctly, have you...


slack---line wrote:
check that the router is configured with valid DNS
servers. These are usually provided by your ISP, but you can always add
secondary (and sometimes tertiary) DNS serves so Google's 4.4.4.4 and 8.8.8.8
are good, simple options.



You say you substituted in 4.4.4.4, but as written its ambiguous and it sounds
as though you did this on your computer rather than your router perhaps
(although of course you may have meant you tried it on your router, but thats
not clear from how you've written it).


I misread your previous message and substituted 4.4.4.4 in my resolv.conf, not
my router. Regardless all the other computer on the network access the
Internet, through the same router, without a problem. Thus the problem does
no lie with the router.
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8925

PostPosted: Sat Dec 29, 2012 5:37 pm    Post subject: Reply with quote

tempuser wrote:
Hu wrote:
What is the output of dig hostname @<censored>; dig hostname @4.4.4.4?

dig hostname @<censored>:
Code:

; <<>> DiG 9.9.2 <<>> hostname @<censored>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 54598
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;hostname.         IN   A
dig hostname @4.4.4.4:
Code:
; <<>> DiG 9.9.2 <<>> hostname @4.4.4.4
;; global options: +cmd
;; connection timed out; no servers could be reached
Although you mishandled the commands I gave you, the output is still useful. This seems to show that you simply cannot talk to 4.4.4.4 at all, so failure while using it does not excuse your router. Currently, 4.4.4.4 is not answering me either. Perhaps it no longer serves requests from arbitrary Internet users. Server 8.8.8.8 does answer me. Does it answer you?
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Sat Dec 29, 2012 9:08 pm    Post subject: Reply with quote

Hu wrote:
Although you mishandled the commands I gave you, the output is still useful. This seems to show that you simply cannot talk to 4.4.4.4 at all, so failure while using it does not excuse your router. Currently, 4.4.4.4 is not answering me either. Perhaps it no longer serves requests from arbitrary Internet users. Server 8.8.8.8 does answer me. Does it answer you?

Yes.
dig hostname @8.8.8.8:
Code:


; <<>> DiG 9.9.2 <<>> hostname @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 8048
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;hostname.         IN   A

;; AUTHORITY SECTION:
.         1800   IN   SOA   a.root-servers.net. nstld.verisign-grs.com. 2012122901 1800 900 604800 86400

;; Query time: 48 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Dec 29 21:02:49 2012
;; MSG SIZE  rcvd: 112

Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Mon Dec 31, 2012 3:03 pm    Post subject: Reply with quote

A breakthrough, running w3m with the '-4' option fixes the problem for that application. For w3m it appears the problem consisted of using ipv6 on a network that does not support it. This still raises the question why the problem appeared, across the system, after an emerge update. Are there any system configs that might have caused this.
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8925

PostPosted: Mon Dec 31, 2012 11:46 pm    Post subject: Reply with quote

Some versions of glibc, when asked to resolve a name as IPv4 or IPv6, issue DNS queries in a way that can confuse certain braindamaged DNS servers into giving bad responses. I thought that such versions were not in circulation, but looking back, I see you never said what you updated or gave us any details about your system. What is the output of emerge --info? What exactly did you update between when the system was normal and when you first encountered problems?
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Wed Jan 02, 2013 2:58 pm    Post subject: Reply with quote

Another breakthrough, the problem with w3m stems from the 'getaddrinfo()'
system function misbehaving. The following program demonstrates this.

Test program:
Code:

#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>

void testgetaddrinfo( const char * title , const char * service , int ai_family );

int main( int n , char * * cpp )
{
    testgetaddrinfo("[\"http\", AF_INET]", "http", AF_INET);
    testgetaddrinfo("[\"http\", AF_INET6]", "http", AF_INET6);
    testgetaddrinfo("[\"http\", AF_UNSPEC]", "http", AF_UNSPEC);
    testgetaddrinfo("[\"80\", AF_INET]", "80", AF_INET);
    testgetaddrinfo("[\"80\", AF_INET6]", "80", AF_INET6);
    testgetaddrinfo("[\"80\", AF_UNSPEC]", "80", AF_UNSPEC);
    testgetaddrinfo("[0, AF_INET]", 0, AF_INET);
    testgetaddrinfo("[0, AF_INET6]", 0, AF_INET6);
    testgetaddrinfo("[0, AF_UNSPEC]", 0, AF_UNSPEC);
}

void testgetaddrinfo( const char * title , const char * service , int ai_family )
{
    struct addrinfo hints;
    struct addrinfo * pai;
    int gai_rval;

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = ai_family;
    hints.ai_socktype = SOCK_STREAM;

    gai_rval = getaddrinfo("www.youtube.com", service, &hints, &pai);
    if (!gai_rval)
    {
        freeaddrinfo(pai);
   printf("%s: Success\n", title);
    }
    else
    {
       printf("%s: getaddrinfo() return value %d (%s). ", title, gai_rval, gai_strerror(gai_rval));
   if (gai_rval == EAI_SYSTEM)
       printf("errno = %d.", errno);
   printf("\n");
    }
}


Output:
Code:

["http", AF_INET]: Success
["http", AF_INET6]: getaddrinfo() return value -11 (System error). errno = 0.
["http", AF_UNSPEC]: getaddrinfo() return value -11 (System error). errno = 0.
["80", AF_INET]: Success
["80", AF_INET6]: getaddrinfo() return value -11 (System error). errno = 0.
["80", AF_UNSPEC]: getaddrinfo() return value -11 (System error). errno = 0.
[0, AF_INET]: Success
[0, AF_INET6]: Success
[0, AF_UNSPEC]: Success


In other words if one calls 'getaddrinfo()' with a non-null service and the
address family hinted as 'AF_INET6' or 'AF_UNSPEC' then the function returns a
value indicating a system error without setting errno. The 'getaddrinfo()'
man page does not describe this behaviour as valid.

I would appreciate any suggestions.
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8925

PostPosted: Wed Jan 02, 2013 11:41 pm    Post subject: Reply with quote

Are you sure errno is unset? Your test program calls printf before reading the value of errno, so printf could be clearing a valid error code.
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Thu Jan 03, 2013 3:27 pm    Post subject: Reply with quote

I do not believe that that would explain the behaviour. In any case I have
altered the program to:
Code:

#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>

void testgetaddrinfo( const char * title , const char * service , int ai_family );

int main( int n , char * * cpp )
{
    testgetaddrinfo("[\"http\", AF_INET]", "http", AF_INET);
    testgetaddrinfo("[\"http\", AF_INET6]", "http", AF_INET6);
    testgetaddrinfo("[\"http\", AF_UNSPEC]", "http", AF_UNSPEC);
    testgetaddrinfo("[\"80\", AF_INET]", "80", AF_INET);
    testgetaddrinfo("[\"80\", AF_INET6]", "80", AF_INET6);
    testgetaddrinfo("[\"80\", AF_UNSPEC]", "80", AF_UNSPEC);
    testgetaddrinfo("[0, AF_INET]", 0, AF_INET);
    testgetaddrinfo("[0, AF_INET6]", 0, AF_INET6);
    testgetaddrinfo("[0, AF_UNSPEC]", 0, AF_UNSPEC);
}

void testgetaddrinfo( const char * title , const char * service , int ai_family )
{
    struct addrinfo hints;
    struct addrinfo * pai;
    int gai_rval;
    int errnocopy;

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = ai_family;
    hints.ai_socktype = SOCK_STREAM;

    gai_rval = getaddrinfo("www.youtube.com", service, &hints, &pai);
    errnocopy = errno;
    if (!gai_rval)
    {
        freeaddrinfo(pai);
        printf("%s: Success\n", title);
    }
    else
    {
        printf("%s: getaddrinfo() return value %d (%s). ", title, gai_rval, gai_strerror(gai_rval));
        if (gai_rval == EAI_SYSTEM)
            printf("errno = %d.", errnocopy);
        printf("\n");
    }
}


The output has not changed.
Back to top
View user's profile Send private message
tempuser
n00b
n00b


Joined: 24 Aug 2011
Posts: 55

PostPosted: Sat Jan 05, 2013 10:25 am    Post subject: Reply with quote

Anyone?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9011
Location: beyond the rim

PostPosted: Fri Jan 11, 2013 9:02 am    Post subject: Reply with quote

Sounds like this patch could be the troublemaker: http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cfde9b463d63092ff0908d4c2748ace648e2ead8#patch5
Back to top
View user's profile Send private message
tipp98
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2007
Posts: 110

PostPosted: Wed Jan 16, 2013 6:08 am    Post subject: Reply with quote

I am possibly having the same issue after @world update. If it is related to glibc then there is more to the story because I have the same version, glibc-2.15-r3, on two computers, one is fine. It could also have something to do with baselayout 2.2, as that is on the broken computer and not the other. Another difference is that the broken one had -ipv6 in make.conf, the other did not.

# cat /etc/conf.d/network
Code:
ifconfig_eth0="192.168.1.44 netmask 255.255.255.0"
defaultroute="gw 192.168.1.1"

# route -n
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo                              <---added by me, from the working computer
127.0.0.0       -               255.0.0.0       !     0      -        0 -                               <---not on working computer
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

# cat /etc/resolv.conf
Code:
nameserver 192.168.1.1

# ifconfig
Code:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.44  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::216:76ff:fec9:2b65  prefixlen 64  scopeid 0x20<link>
        ether 00:16:76:c9:2b:65  txqueuelen 1000  (Ethernet)
        RX packets 1143  bytes 103961 (101.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1077  bytes 240247 (234.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xe4500000-e4520000 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 67  bytes 7244 (7.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 67  bytes 7244 (7.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Back to top
View user's profile Send private message
tipp98
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2007
Posts: 110

PostPosted: Wed Jan 16, 2013 3:49 pm    Post subject: Reply with quote

Ok, my problem became apparent after booting from a backup drive, when things still did not work. Seems after the post update reboot my router got confused and stopped sending dns to the computer. After router reboot I am ok.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum