"Address already in use" even when it's not
See original GitHub issueHi
I am running multiple mitmproxy instances on one machine. Each instance has its own port between 49000 and 50000. All instances are listening on interface 0.0.0.0
. Instances stop and restart multiple times per hour.
Most instances start fine. However, a few random ones will fail with the error that address is already in use:
$ mitmproxy -p 49338 Error starting proxy server: error(98, 'Address already in use')
However, netstat does not show any process using the port:
$ sudo netstat -nlp | grep 49338
I also do not see any zombie processes trying to start the same instance.
Any idea what’s causing this? Is the problem that every instance is listening on 0.0.0.0? How does mitmproxy decide whether a port is “open”?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Address already in use but nothing in netstat or lsof
In this state attempting to use nc to listen on port 10000 fails with Address already in use, but neither lsof not ss...
Read more >How to kill server when seeing “EADDRINUSE: address ...
Solution. When this EADDRINUSE issue has already happened, in order to resolve it, you need to kill the process manually. In order to...
Read more >How to fix error “Address already in use” - remarkablemark
To fix the error “Address already in use” (EADDRINUSE), kill the process associated with the port.
Read more >Bind: Address Already in Use
Oddly, using SO_REUSEADDR can actually lead to more difficult "address already in use" errors. SO_REUSADDR permits you to use a port that is...
Read more >Invalid 'bind' call, error: ('98' - 'Address already in use').
Please check for any processes running which shouldn't be running on that port or try providing a different port number in the .ini...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just in case above solutions didn’t work:
Follows the below steps:
Get the port your process is listening to: $ ps ax | grep python
Kill the Process $ kill PROCESS_NAME
I ran into this problem too an not found any solution yet. Someone said about
ps -f ax | grep mitm
I tried an kill the processes in ps command result but mitmproxy still can not be started. The error message is the same.