I recently updated my app and tried to run it, and got the following error about "Address already in use". What does this mean and how do I fix it?
Traceback (most recent call last):
File "/home/ubuntu/workspace/app.py", line 11, in <module>
app.run(host = os.getenv('IP', '0.0.0.0'), port=int(os.getenv('PORT',8080)))
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 772, in run
run_simple(host, port, self, **options)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 687, in run_simple
inner()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 653, in inner
fd=fd).serve_forever()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 557, in make_server
passthrough_errors, ssl_context, fd=fd)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 467, in __init__
HTTPServer.__init__(self, (host, int(port)), handler)
File "/usr/lib/python2.7/SocketServer.py", line 419, in __init__
self.server_bind()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.7/SocketServer.py", line 430, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
8080
in this case). Maybe because you forgot close another running Flask app and it's using8080
port. – Casimir Crystal Dec 24 '15 at 21:21nmap
ornetcat
to check which program is using that port. Here's another question and the accepted answer is usingnetcat
, check it: unix.stackexchange.com/questions/106561/… – Casimir Crystal Dec 24 '15 at 21:25