The Fix
Upgrade to version 0.19.0 or later.
Based on closed Kludex/uvicorn issue #480 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -20,7 +20,6 @@ files =
uvicorn/protocols/websockets/auto.py,
uvicorn/supervisors/__init__.py,
- uvicorn/middleware/debug.py,
uvicorn/middleware/wsgi.py,
uvicorn/supervisors/watchfilesreload.py,
Option A — Upgrade to fixed release\nUpgrade to version 0.19.0 or later.\nWhen NOT to use: Do not use this fix if your application relies on the `--debug` flag for error handling.\n\n
Why This Fix Works in Production
- Trigger: * `--reload`/`reload=True` (A server-level concern. Reload the server on code changes.)
- Mechanism: The `--debug` flag was hidden and not useful for applications using frameworks like Starlette
- Why the fix works: Removes the `--debug` flag in favor of using `--reload`. (first fixed release: 0.19.0).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The `--debug` flag was hidden and not useful for applications using frameworks like Starlette
- Production symptom (often without a traceback): * `--reload`/`reload=True` (A server-level concern. Reload the server on code changes.)
Proof / Evidence
- GitHub issue: #480
- Fix PR: https://github.com/kludex/uvicorn/pull/1640
- First fixed release: 0.19.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.73
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Really we ought to phase out the usage of --debug/debug=True, in favour of... * --reload/reload=True (A server-level concern. Reload the server on code changes.) * app = Starlette(debug=True) (An application level concern. Issue nice HTML t”
Failure Signature (Search String)
- * `--reload`/`reload=True` (A server-level concern. Reload the server on code changes.)
- * `app = Starlette(debug=True)` (An application level concern. Issue nice HTML tracebacks for the "500 Server Error" case.)
Copy-friendly signature
Failure Signature
-----------------
* `--reload`/`reload=True` (A server-level concern. Reload the server on code changes.)
* `app = Starlette(debug=True)` (An application level concern. Issue nice HTML tracebacks for the "500 Server Error" case.)
Error Message
Signature-only (no traceback captured)
Error Message
-------------
* `--reload`/`reload=True` (A server-level concern. Reload the server on code changes.)
* `app = Starlette(debug=True)` (An application level concern. Issue nice HTML tracebacks for the "500 Server Error" case.)
What Broke
The presence of the `--debug` flag did not provide useful error information for clients.
Why It Broke
The `--debug` flag was hidden and not useful for applications using frameworks like Starlette
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.19.0 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/kludex/uvicorn/pull/1640
First fixed release: 0.19.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if your application relies on the `--debug` flag for error handling.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.19.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.