Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1899 (closed defect: wontfix)

Opened 11 years ago

Last modified 9 years ago

Unable to bind to all IPv4 addresses (INADDR_ANY) on dual-stack system.

Reported by: guest Owned by: anonymous
Priority: normal Milestone: irrespective
Component: TurboGears Version: 1.0.5
Severity: normal Keywords:
Cc:

Description

Using Windows Vista with IPv6 enabled (and functional), Turbogears by default will bind to the IPv6 address and will not listen on the IPv4 address(es).

Specifying to listen on a specific IPv4 address works (i.e. 222.222.222.222 or 127.0.0.1), but it fails when server.socket_host is set to '0.0.0.0' (the code for INADDR_ANY, any IPv4 interface) with the following error:

2008-07-14 09:56:01,351 cherrypy.msg INFO HTTP: Port 8080 not bound on '0.0.0.0' Unhandled exception in thread started by <bound method Server._start of <cherrypy._cpserver.Server object at 0x02D7C310>

Traceback (most recent call last):

File "c:\python\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cpserver.py", line 79, in _start

self.start_http_server()

File "c:\python\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cpserver.py", line 127, in start_http_server

self.wait_for_http_ready()

File "c:\python\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cpserver.py", line 162, in wait_for_http_ready

raise cherrypy.NotReady?("Port not bound.")

cherrypy._cperror.NotReady?: Port not bound.

If in development mode, the application will continue to run, I suspect because of the autoreload thread keeping things alive. In production mode, this exception terminates the service.

This issue is a bug in cherrypy which appears to have been fixed in more recent versions. Robust IPv6 support is yet another reason to consider the move to CherryPy? 3.0+ with TG 1.1.

Change History

comment:1 Changed 11 years ago by Chris Arndt

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone set to __unclassified__

Yes, you are right, this is a bug in CherryPy, as already discovered in this #1713 (comment no. 15).

There isn't much we can do about this than working around it (by setting server.socket_host to a specific address or by using IPv6 networking) and wait until CP 3 support is there or a CP 2.3 bugfix release witha a backport of  this CherryPy changeset comes out (unlikely).

You can always put a reverse proxy in front of your TG server, if you need to support both IPv6 and IPv4 or several IPv4 addresses.

comment:2 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to irrespective
Note: See TracTickets for help on using tickets.