--server option doesn't properly handle ipv6 ip addresses

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
jcfp
Release Testers
Release Testers
Posts: 988
Joined: February 7th, 2008, 12:45 pm

--server option doesn't properly handle ipv6 ip addresses

Post by jcfp »

The following holds for a single ip like ::1 (localhost) as well as :: (ipv6 equivalent of 0.0.0.0), and happens with both the 0.3.4 and the 0.4 beta2 releases.

Ipv6 ip addresses are normally written between square brackets in url etc. Unfortunately, specifying [::1]:8080 as the argument to the --server option one gets this:
2008-04-15 18:13:19,021::INFO::Starting web-interface on [::1]:8080
[...]
2008-04-15 18:13:19,352::ERROR::Failed to start web-interface
Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 672, in main
    cherrypy.server.start(init_only=True)
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 72, in start
    Engine.start(self)
  File "/var/lib/python-support/python2.5/cherrypy/_cpengine.py", line 104, in start
    self._start()
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 79, in _start
    self.start_http_server()
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 99, in start_http_server
    wait_for_free_port(host, port)
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 244, in wait_for_free_port
    check_port(host, port)
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 219, in check_port
    socket.SOCK_STREAM):
gaierror: (-2, 'Name or service not known')
Meanwhile, without brackets (--server ::1:8080) the result is that the web interface does start correctly, but the browser is instructed to open an invalid address (brackets missing in the url):
2008-04-15 18:12:48,538::INFO::Starting web-interface on ::1:8080
[...]
2008-04-15 18:12:48,867::INFO::Lauching browser with http://::1:8080/sabnzbd
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: --server option doesn't properly handle ipv6 ip addresses

Post by shypike »

It works fine on my Vista64 test system. I don't have a ipv6 capable Linux system to test.
[::] will not work, since it's not supported by CherryPy2, but [::1] is OK.
User avatar
jcfp
Release Testers
Release Testers
Posts: 988
Joined: February 7th, 2008, 12:45 pm

Re: --server option doesn't properly handle ipv6 ip addresses

Post by jcfp »

Seems this stuff is highly operating system dependent; I'm getting quite different results on Linux, see attached file. Listening on ipv6 works only when no square brackets are used, and at the same time a port number is specified. On the bright side of things, note the last case, which has cherrypy 2 listening on all ipv6 addresses.

Btw, IIRC even Linux based live-cds such as the Ubuntu ones have ipv6 support enabled by default so finding a testing platform shouldn't be too hard.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: --server option doesn't properly handle ipv6 ip addresses

Post by shypike »

Will be fixed in Beta3.
User avatar
jcfp
Release Testers
Release Testers
Posts: 988
Joined: February 7th, 2008, 12:45 pm

Re: --server option doesn't properly handle ipv6 ip addresses

Post by jcfp »

Thanks!
Post Reply