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 #1726 (closed defect: worksforme)

Opened 11 years ago

Last modified 11 years ago

No error when dev server listens on an occupied port

Reported by: mboersma Owned by: anonymous
Priority: normal Milestone: 2.0
Component: TurboGears Version: trunk
Severity: normal Keywords: port listen
Cc: lmacken


I had an instance of Apache already listening at port 8080 on When I start "paster serve --reload development.ini" it reports no errors and claims to be listening on port 8080, but all HTTP requests are serviced by Apache. I tried the same with a few other port configurations, and TG2 gladly starts on any occupied port.

Two processes can't open the same TCP port for listening, so it seems the correct behavior would be to raise a SocketError?.

Change History

comment:1 Changed 11 years ago by lmacken

What version of Paste are you using ?

I get the following traceback when trying to reproduce this with the latest Paste svn:

Traceback (most recent call last):
  File "/home/lmacken/tg2/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.6.2', 'console_scripts', 'paster')()
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", line 79, in run
    invoke(command, command_name, options, args[1:])
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", line 118, in invoke
    exit_code = runner.run(args)
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/command.py", line 213, in run
    result = self.command()
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/serve.py", line 257, in command
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 140, in server_wrapper
  File "/home/lmacken/tg2/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/lmacken/tg2/Paste-dev/paste/httpserver.py", line 1327, in server_runner
    serve(wsgi_app, **kwargs)
  File "/home/lmacken/tg2/Paste-dev/paste/httpserver.py", line 1277, in serve
  File "/home/lmacken/tg2/Paste-dev/paste/httpserver.py", line 1127, in __init__
    RequestHandlerClass, ssl_context)
  File "/home/lmacken/tg2/Paste-dev/paste/httpserver.py", line 1107, in __init__
    RequestHandlerClass, ssl_context)
  File "/home/lmacken/tg2/Paste-dev/paste/httpserver.py", line 328, in __init__
    HTTPServer.__init__(self, server_address, RequestHandlerClass)
  File "/usr/lib/python2.5/SocketServer.py", line 330, in __init__
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 101, in server_bind
  File "/usr/lib/python2.5/SocketServer.py", line 341, in server_bind
  File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')

That seems like the Right Way to handle this, no ?

comment:2 Changed 11 years ago by lmacken

  • Cc lmacken added

comment:3 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to worksforme

I can't reproduce this behavior either -- perhaps there is something system-config specific going on for the original poster...

Note: See TracTickets for help on using tickets.