I have a CherryPy script that I often run to start the server. Today I had to start and stop it several times in order to fix some errors in the configuration file, and I think the socket did not close completely, because when I tried to start it again, I got this problem:
[23/Mar/2015:14:08:00] ENGINE Listening for SIGHUP. [23/Mar/2015:14:08:00] ENGINE Listening for SIGTERM. [23/Mar/2015:14:08:00] ENGINE Listening for SIGUSR1. [23/Mar/2015:14:08:00] ENGINE Bus STARTING CherryPy Checker: The Application mounted at '' has an empty config. [23/Mar/2015:14:08:00] ENGINE Started monitor thread 'Autoreloader'. [23/Mar/2015:14:08:00] ENGINE Started monitor thread '_TimeoutMonitor'. [23/Mar/2015:14:08:00] ENGINE Error in HTTP server: shutting down Traceback (most recent call last): File "/home/andrew/virtualenvs/mikernels/lib/python2.7/site-packages/cherrypy/process/servers.py", line 188, in _start_http_thread self.httpserver.start() File "/home/andrew/virtualenvs/mikernels/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1848, in start raise socket.error(msg) error: No socket could be created
I edited CherryPy wsgiserver2.py to see socket details .error and error.strerror was
98 (98, 'Address already in use') Address already in use
Meanwhile, my socket is built as:
af = 2 socktype = 1 proto = 6 canonname = '' sa = ('0.0.0.0', 2112) self.bind(af, socktype, proto)
(this is not the exact code, but the fact that the values ββat the start of the error)
I checked netstat and did not see anything listening on port 2112, which can cause a problem and how can I diagnose it?
Thanks!
source share