python
system_error
ai_generated
true
OSError: [Errno 98] Address already in use
ID: python/flask-debug-reloader-port-in-use
80%Fix Rate
87%Confidence
0Evidence
2024-05-19First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
A previous Flask dev server (or the reloader child) is still bound to the port, preventing the new process from binding.
generic中文
之前的 Flask 开发服务器(或重载器子进程)仍占用该端口,导致新进程无法绑定。
Workarounds
-
95% success
lsof -ti:5000 | xargs kill -9
-
90% success
app.run(port=5001)
Dead Ends
Common approaches that don't work:
-
80% fail
Only avoids the second process; the original is still bound.
-
85% fail
Does not free the port held by the old process.