The Fix
Upgrade to version 0.14.0 or later.
Based on closed Kludex/uvicorn issue #924 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -53,7 +53,7 @@ def get_packages(package):
extra_requirements = [
"websockets>=8.*",
- "httptools==0.1.* ;" + env_marker_cpython,
+ "httptools==0.2.* ;" + env_marker_cpython,
"uvloop>=0.14.0,!=0.15.0,!=0.15.1; " + env_marker_cpython,
Option A — Upgrade to fixed release\nUpgrade to version 0.14.0 or later.\nWhen NOT to use: This fix is not applicable if the underlying issue is not related to httptools.\n\n
Why This Fix Works in Production
- Trigger: url parsing in httptools is still handled by http-parser and llhttp has a long standing enhancement request to provide a way to do it, so using the new…
- Mechanism: Httptools does not handle long URLs properly due to reliance on an outdated HTTP parser
- Why the fix works: Updated httptools from version 0.1.* to 0.2.* to replace the underlying HTTP parser with llhttp as http-parser is no longer actively maintained. (first fixed release: 0.14.0).
- If left unfixed, retries/timeouts can trigger duplicate external side-effects (double charges, duplicate emails, repeated writes).
Why This Breaks in Prod
- Httptools does not handle long URLs properly due to reliance on an outdated HTTP parser
- Production symptom (often without a traceback): url parsing in httptools is still handled by http-parser and llhttp has a long standing enhancement request to provide a way to do it, so using the new httptools version in fact does not change anything to this issue
Proof / Evidence
- GitHub issue: #924
- Fix PR: https://github.com/encode/uvicorn/pull/1024
- First fixed release: 0.14.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.72
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“jfyk, @victoraugustolls PR was merged, and we have a PR using the new httptools version: https://github.com/encode/uvicorn/pull/1024”
“closing this a wontfix since it's an issue upstream > upstream (httptools using http-parse for url parsing)”
“@euri10 There is a pr to move httptools from http-parser tô llhttp. If the bug is in http-parser, this might help!”
“Cool, I subscribed to it thanks for the heads up @victoraugustolls !”
Failure Signature (Search String)
- url parsing in httptools is still handled by http-parser and llhttp has a long standing enhancement request to provide a way to do it, so using the new httptools version in fact
Copy-friendly signature
Failure Signature
-----------------
url parsing in httptools is still handled by http-parser and llhttp has a long standing enhancement request to provide a way to do it, so using the new httptools version in fact does not change anything to this issue
Error Message
Signature-only (no traceback captured)
Error Message
-------------
url parsing in httptools is still handled by http-parser and llhttp has a long standing enhancement request to provide a way to do it, so using the new httptools version in fact does not change anything to this issue
What Broke
Multiple calls to on_url for long URLs causing unexpected behavior.
Why It Broke
Httptools does not handle long URLs properly due to reliance on an outdated HTTP parser
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.14.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/encode/uvicorn/pull/1024
First fixed release: 0.14.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the underlying issue is not related to httptools.
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.14.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.