Page 1 of 1
[Errno 47] Address family not supported by protocol
Posted: November 5th, 2012, 4:19 pm
by Bascy
I've been running Sabnzbd on my Readynas Duo V1 for some time now. I didnt use it for a few months and after i updated to 0.7.4 (using Python 2.7) i cannot seem to connect to the news server of my own provider, When going through the wizard of Sabnzb, filling in the serveraddress news.onsnet.nu and testing the connection, I get the error
[Errno 47] Address family not supported by protocol
If i try to connect from a commandpromtp using telnet, everything seems to be working and i cant seem to find anything usefull that is relatoed to this error
Where should i start looking to solve this?
Re: [Errno 47] Address family not supported by protocol
Posted: November 5th, 2012, 4:34 pm
by shypike
I see that news.onsnet.nu gives IPv6 addresses priority over IPv4.
Very unusual.
Most modern OS's (like Win7 and recent OSX-s) know what to with this,
but possibly a more basic OS doesn't.
As a work-around, you can replace news.onsnet.nu with either 195.200.85.11 or 195.200.85.12
I'll see if I can do anything about this.
Re: [Errno 47] Address family not supported by protocol
Posted: November 5th, 2012, 5:05 pm
by shypike
Are you trying "telnet" from the command prompt of the ReadyNas or your PC?
The PC will work fine, possibly not the ReadyNAS.
Open a command prompt on the ReadyNas.
Type:
Then type:
Code: Select all
import socket
print socket.getaddrinfo("news.onsnet.nu", 119, 0, socket.SOCK_STREAM)
Then cut&paste into a reply.
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 3:36 am
by Bascy
Result of getaddrinfo:
Code: Select all
[(10, 1, 6, '', ('2a01:788:2:1::c013:1', 119, 0, 0)), (10, 1, 6, '', ('2a01:788:2:1::c013:2', 119, 0, 0)), (2, 1, 6, '', ('195.200.85.12', 119)), (2, 1, 6, '', ('195.200.85.11', 119))]
Tested it with the IP address in stead of the servername, and everything seems to be working! Thanks for the tip
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 12:41 pm
by shypike
OK, that output explains a lot.
There's an error in the Python implementation of the ReadyNAS.
The getaddrinfo fucntion lists IPv6 addresses (2a01:788:2:1::c013:1) while it should only list
IPv4 (195.200.85.12).
I'm not sure whether a proper fix is possible, but I'll try.
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 1:07 pm
by sander
shypike wrote:OK, that output explains a lot.
There's an error in the Python implementation of the ReadyNAS.
The getaddrinfo fucntion lists IPv6 addresses (2a01:788:2:1::c013:1) while it should only list
IPv4 (195.200.85.12).
I don't completely understand you, as I get the same output on my Ubuntu:
Code: Select all
>>> import socket
>>> print socket.getaddrinfo("news.onsnet.nu", 119, 0, socket.SOCK_STREAM)
[(10, 1, 6, '', ('2a01:788:2:1::c013:2', 119, 0, 0)), (10, 1, 6, '', ('2a01:788:2:1::c013:1', 119, 0, 0)), (2, 1, 6, '', ('195.200.85.12', 119)), (2, 1, 6, '', ('195.200.85.11', 119))]
>>>
... so: both IPv4 and IPv6. And no problems.
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 2:05 pm
by shypike
True, but the real problem is that getaddrinfo() shouldn't do that when the system cannot handle the IPv6 address.
I know your system can, but most cannot.
My Windows, OSX and Ubuntu systems all have IPv6 enabled, but have no routing to external IPv6
and subsequently Windows's getaddrinfo() returns only IPV4 and OSX & Ubuntu return IPv4 as the first.
Other than that, it makes no sense for news.onsnet.nu to list an IPv6 address as the first one.
Having said that, it does make me realize that the code assumes that the standard getaddrinfo()
returns only IPv4 addresses or at least that they give usable IPs.
However, it can return a mixture, some of which may not even work.
This may explain some of the trouble that the infamous randomize_server_ip causes in some situations.
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 2:18 pm
by sander
Well, see this IPv4-only setup, and getaddrinfo() returning both IPv4 and IPv6:
Code: Select all
pi@raspberrypi ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:96:c4:2f
inet addr:192.168.1.55 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9049 (8.8 KiB) TX bytes:13562 (13.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
pi@raspberrypi ~ $
pi@raspberrypi ~ $ python
Python 2.7.3rc2 (default, May 6 2012, 20:02:25)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> print socket.getaddrinfo("news.onsnet.nu", 119, 0, socket.SOCK_STREAM)
[(2, 1, 6, '', ('195.200.85.11', 119)), (2, 1, 6, '', ('195.200.85.12', 119)), (10, 1, 6, '', ('2a01:788:2:1::c013:1', 119, 0, 0)), (10, 1, 6, '', ('2a01:788:2:1::c013:2', 119, 0, 0))]
>>>
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
pi@raspberrypi ~ $
EDIT:
On this IPv4 only setup:
newszilla6.xs4all.nl (ipv6 only) results in "[Errno 97] Address family not supported by protocol", which is correct.
news.onsnet.nu results in "Timed out", so apparantly on my setup SAB first uses the IPv4 address
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 3:06 pm
by shypike
sander wrote:Well, see this IPv4-only setup, and getaddrinfo() returning both IPv4 and IPv6:
Which is just a rather bad implementation.
Having an IPv4-only system and still resolving names to IPv6.
Sent you some questions by email.
Re: [Errno 47] Address family not supported by protocol
Posted: November 6th, 2012, 3:12 pm
by sander
shypike wrote:sander wrote:Well, see this IPv4-only setup, and getaddrinfo() returning both IPv4 and IPv6:
Which is just a rather bad implementation.
Having an IPv4-only system and still resolving names to IPv6.
Well, also the 'host' command gives both IPv4 and IPv6 addresses on my IPV4-only system
Code: Select all
pi@raspberrypi ~ $ host news.onsnet.nu
news.onsnet.nu is an alias for edutel.xlned.com.
edutel.xlned.com has address 195.200.85.11
edutel.xlned.com has address 195.200.85.12
edutel.xlned.com has IPv6 address 2a01:788:2:1::c013:1
edutel.xlned.com has IPv6 address 2a01:788:2:1::c013:2
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $ host edutel.xlned.com.
edutel.xlned.com has address 195.200.85.12
edutel.xlned.com has address 195.200.85.11
edutel.xlned.com has IPv6 address 2a01:788:2:1::c013:1
edutel.xlned.com has IPv6 address 2a01:788:2:1::c013:2
pi@raspberrypi ~ $
pi@raspberrypi ~ $ host www.google.com
www.google.com has address 173.194.67.147
www.google.com has address 173.194.67.106
www.google.com has address 173.194.67.99
www.google.com has address 173.194.67.105
www.google.com has address 173.194.67.104
www.google.com has address 173.194.67.103
www.google.com has IPv6 address 2a00:1450:400c:c05::6a
pi@raspberrypi ~ $