Page 1 of 1

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

Posted: April 15th, 2008, 11:56 am
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

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

Posted: April 24th, 2008, 2:36 pm
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.

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

Posted: April 25th, 2008, 8:56 am
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.

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

Posted: April 27th, 2008, 5:13 am
by shypike
Will be fixed in Beta3.

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

Posted: April 27th, 2008, 5:26 am
by jcfp
Thanks!