Page 1 of 1

Setup Error on Synology DSM 7: socket.gaierror: [Errno -2] Name or service not known

Posted: February 21st, 2022, 10:56 am
by djenders
Synology DSM 7.0.1-42218 Update 2
Docker 20.10.3-1239
sabnzbd latest from linuxserver/sabnzbd

Can't figure out, for the life of me, why I encounter this error when going through the sabnzbd wizard. I get to the second step, input my news server, press next, and always run into this.

I think it might be triggered by permissions errors but can't tell. I've ensured my folder permissions are set to read/write for the docker user I've created.

Had no issues on DSM 6 with same exact setup. Installed multiple times, recreated my directories, recreated users. Same result.

Ugh, HELP! TIA.

Image

Re: Setup Error on Synology DSM 7

Posted: February 21st, 2022, 12:05 pm
by sander
What is the URL you use to access SABnzbd?

Because: socket.getaddrinfo() gives that error on non-resolvable input. And: is your DNS working?

Code: Select all

>>> socket.getaddrinfo('doesnot.exist.atall', None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Re: Setup Error on Synology DSM 7

Posted: February 21st, 2022, 12:13 pm
by djenders
sander wrote: February 21st, 2022, 12:05 pm What do you fill out as newsserver?

What is the URL you use to access SABnzbd?
Newsserver was news DOT supernews DOT com, which is how I've expressed it in the past. Even tested the connection before hitting next, worked fine.

URL is my diskstation IP and port 5000.

Re: Setup Error on Synology DSM 7

Posted: February 21st, 2022, 12:22 pm
by sander
And what is that URL? If it's on your LAN, I do not understand why people are secretive about it.

I tried some inputs ... all went OK

Code: Select all

>>> socket.getaddrinfo('127.0.0.1', None)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('127.0.0.1', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('127.0.0.1', 0))]
>>> socket.getaddrinfo('4.4.4.4', None)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('4.4.4.4', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('4.4.4.4', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('4.4.4.4', 0))]
>>>
>>> socket.getaddrinfo('4.4.4', None)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('4.4.0.4', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('4.4.0.4', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('4.4.0.4', 0))]
>>> socket.getaddrinfo('::', None)
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('::', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('::', 0, 0, 0))]
>>> socket.getaddrinfo('::1', None)
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('::1', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('::1', 0, 0, 0))]
>>> socket.getaddrinfo('333::1', None)
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('333::1', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('333::1', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('333::1', 0, 0, 0))]
... ah, finally a input that causes a problem:

Code: Select all

>>> socket.getaddrinfo('4.4.4.4.5', None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Re: Setup Error on Synology DSM 7

Posted: February 21st, 2022, 12:31 pm
by djenders
I didn't post the IP address because it kept getting flagged with a link warning for new users.

192 DOT 168 DOT 1 DOT 76

Re: Setup Error on Synology DSM 7: socket.gaierror: [Errno -2] Name or service not known

Posted: February 21st, 2022, 12:46 pm
by sander
Hmm. That doesn't ring a bell.

But, looking at https://github.com/sabnzbd/sabnzbd/blob ... #L588-L600 :

Two times that "addresses = socket.getaddrinfo(host, None)" is there, but only in the first case (0.0.0.0) there is try-except. In the second case, if the socket.getaddrinfo() goes wrong, there is no except, and the Traceback can happen. Which happens to you.

Easy to change the code ... but as within SAB I can't reproduce the error you have, I cannot verify that the fix is a fix.

Re: Setup Error on Synology DSM 7: socket.gaierror: [Errno -2] Name or service not known

Posted: February 21st, 2022, 12:50 pm
by sander
Ah, wait: IP address not relevant! It's this line https://github.com/sabnzbd/sabnzbd/blob ... ce.py#L583

within a docker, about anything can come from socket.gethostname() ... And if you then query that via DNS ... brrrrrrrrr ....


FWIW: it went OK inside this docker, but I guess something goes wrong in your docker

Code: Select all

root@a3ba0367803d:/# python3
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname().lower()
'a3ba0367803d'
>>> host = socket.gethostname().lower()
>>> socket.getaddrinfo(host, None)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.17.0.3', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('172.17.0.3', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('172.17.0.3', 0))]
>>>

Re: Setup Error on Synology DSM 7: socket.gaierror: [Errno -2] Name or service not known

Posted: February 21st, 2022, 12:54 pm
by djenders
sander wrote: February 21st, 2022, 12:50 pm Ah, wait: IP address not relevant! It's this line https://github.com/sabnzbd/sabnzbd/blob ... ce.py#L583

within a docker, about anything can come from socket.gethostname() ... And if you then query that via DNS ... brrrrrrrrr ....


FWIW: it went OK inside this docker:
That's what I was thinking too. Wonder if it's the difference between setting the network up as a bridge or same as the docker host.

Re: Setup Error on Synology DSM 7: socket.gaierror: [Errno -2] Name or service not known

Posted: February 21st, 2022, 1:01 pm
by djenders
djenders wrote: February 21st, 2022, 12:54 pm
sander wrote: February 21st, 2022, 12:50 pm Ah, wait: IP address not relevant! It's this line https://github.com/sabnzbd/sabnzbd/blob ... ce.py#L583

within a docker, about anything can come from socket.gethostname() ... And if you then query that via DNS ... brrrrrrrrr ....


FWIW: it went OK inside this docker:
That's what I was thinking too. Wonder if it's the difference between setting the network up as a bridge or same as the docker host.
Confirmed, it's definitely the network settings when I setup the Docker container. I've seen more than a few guides and posts suggest setting this to "Use the same network as Docker host."

Just reinstalled without, and it's working fine. Might make my directories and permissions a bit more difficult to setup.

Image