Socket Error

Get help with all aspects of SABnzbd
Post Reply
b230614
Newbie
Newbie
Posts: 3
Joined: December 30th, 2012, 2:38 am

Socket Error

Post by b230614 » December 30th, 2012, 2:57 am

Hello all

After starting up my computer today I noticed SAB did not start. After re-installing and altering different settings I still am unable to get SAB working again.

The following output is the result of trying to start SAB.

Code: Select all

[[email protected] ~]$ sabnzbd
Traceback (most recent call last):
  File "/opt/sabnzbd/SABnzbd.py", line 66, in <module>
    import sabnzbd
  File "/opt/sabnzbd/sabnzbd/__init__.py", line 73, in <module>
    from sabnzbd.nzbqueue import NzbQueue
  File "/opt/sabnzbd/sabnzbd/nzbqueue.py", line 41, in <module>
    import sabnzbd.downloader
  File "/opt/sabnzbd/sabnzbd/downloader.py", line 33, in <module>
    from sabnzbd.newswrapper import NewsWrapper, request_server_info
  File "/opt/sabnzbd/sabnzbd/newswrapper.py", line 449, in <module>
    _EXTERNAL_IPV6 = test_ipv6()
  File "/opt/sabnzbd/sabnzbd/newswrapper.py", line 435, in test_ipv6
    socket.IPPROTO_IP, socket.AI_CANONNAME)
socket.error: [Errno 0] Error
Also when trying to diagnosis SAB, SAB will randomly decide to start. But then fails to start when trying to replicate what I just changed.

Thanks in advance for the help.

User avatar
sander
Release Testers
Release Testers
Posts: 6080
Joined: January 22nd, 2008, 2:22 pm

Re: Socket Error

Post by sander » December 30th, 2012, 3:28 am

I see "/opt", so you're running SABnzbd on a NAS or so?

On that device, can you run this and post the output here:

Code: Select all

[email protected]:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,socket.IPPROTO_IP, socket.AI_CANONNAME)
[(10, 1, 6, 'www.google.com', ('2a00:1450:400c:c03::63', 80, 0, 0))]
>>> 
[email protected]:~$ 
BTW:
the source code says this:

Code: Select all

def test_ipv6():
    """ Check if external IPv6 addresses are reachable """
    # Use google.com to test IPv6 access
    try:
        info = socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,
                                  socket.IPPROTO_IP, socket.AI_CANONNAME)
    except socket.gaierror:
        return False
so I guess a workaround is to just remove "socket.gaierror" from the code and then run again ... Worth a try?

b230614
Newbie
Newbie
Posts: 3
Joined: December 30th, 2012, 2:38 am

Re: Socket Error

Post by b230614 » December 30th, 2012, 3:45 am

sander wrote:I see "/opt", so you're running SABnzbd on a NAS or so?

On that device, can you run this and post the output here:

Code: Select all

[email protected]:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,socket.IPPROTO_IP, socket.AI_CANONNAME)
[(10, 1, 6, 'www.google.com', ('2a00:1450:400c:c03::63', 80, 0, 0))]
>>> 
[email protected]:~$ 
BTW:
the source code says this:

Code: Select all

def test_ipv6():
    """ Check if external IPv6 addresses are reachable """
    # Use google.com to test IPv6 access
    try:
        info = socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,
                                  socket.IPPROTO_IP, socket.AI_CANONNAME)
    except socket.gaierror:
        return False
so I guess a workaround is to just remove "socket.gaierror" from the code and then run again ... Worth a try?
No it is not a NAS.

Code: Select all

[[email protected] ~]$ python
Python 3.3.0 (default, Dec 22 2012, 21:02:07) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,socket.IPPROTO_IP, socket.AI_CANONNAME)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 0] Error
>>> 
The 'workaround' seemed to do the trick.

Also thanks for the help.

EDIT: Worked for the first start up then failed.
EDIT2: SAB added back what I removed, I changed the permissions of the file so SAB can no longer change things. Seems all good now, thanks again for the help.

User avatar
sander
Release Testers
Release Testers
Posts: 6080
Joined: January 22nd, 2008, 2:22 pm

Re: Socket Error

Post by sander » December 30th, 2012, 4:20 am

You're welcome. Good that it works. A few remarks:

- AFAIK SAB does not change its source code. Maybe the file was in use while you edited it?
- SAB only uses Python 2.x. So for a fully correct test, start python 2 ("python2" on your system?). Can you run the test again, just to be sure?

b230614
Newbie
Newbie
Posts: 3
Joined: December 30th, 2012, 2:38 am

Re: Socket Error

Post by b230614 » December 30th, 2012, 5:04 am

sander wrote:You're welcome. Good that it works. A few remarks:

- AFAIK SAB does not change its source code. Maybe the file was in use while you edited it?
- SAB only uses Python 2.x. So for a fully correct test, start python 2 ("python2" on your system?). Can you run the test again, just to be sure?
Most likely it was opened, as for test it produces the same results as with 'python'.

User avatar
shypike
Administrator
Administrator
Posts: 21002
Joined: January 18th, 2008, 12:49 pm

Re: Socket Error

Post by shypike » December 30th, 2012, 7:07 am

Testing for specific error codes in a multi-platform app is a risk.
I'll change the code accordingly.

Post Reply