The Fix
Upgrade to version 0.11.4 or later.
Based on closed Kludex/uvicorn issue #427 · 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%.
@@ -137,7 +137,8 @@ def connection_lost(self, exc):
self.cycle.disconnected = True
self.message_event.set()
- self.flow.resume_writing()
+ if self.flow is not None:
+ self.flow.resume_writing()
Option A — Upgrade to fixed release\nUpgrade to version 0.11.4 or later.\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n
Why This Fix Works in Production
- Trigger: NoneType' object has no attribute 'resume_writing' on SSL termination
- Mechanism: The flow object was None, causing an AttributeError when attempting to resume writing
- Why the fix works: Fixes an exception on TCP liveness check that caused an AttributeError when SSL termination was attempted. (first fixed release: 0.11.4).
- 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
- Shows up under Python 3.7 in real deployments (not just unit tests).
- The flow object was None, causing an AttributeError when attempting to resume writing
- Surfaces as: Traceback (most recent call last):\n File "uvloop/cbhandles.pyx", line 70, in uvloop.loop.Handle._run\n File…
Proof / Evidence
- GitHub issue: #427
- Fix PR: https://github.com/encode/uvicorn/pull/416
- First fixed release: 0.11.4
- 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.67
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“I think if #416 is merged, the problem will be solved.”
“This is resolved in 0.9.1 (if you're using the default httptools), and in master (if you're using h11)”
“I can reproduce this problem. And it also happens in master branch. connection_made is not called. https://github.com/encode/uvicorn/blob/e0a77de6baf436d182868fa280cd5e2f0d66501c/uvicorn/protocols/http/httptools_impl.py#L119-L129”
“At risk of sounding impatient - is there a work around that can be implemented with 0.9.0 to enable SSL? Very much appreciate any help…”
Failure Signature (Search String)
- NoneType' object has no attribute 'resume_writing' on SSL termination
Error Message
Stack trace
Error Message
-------------
Traceback (most recent call last):\n File "uvloop/cbhandles.pyx", line 70, in uvloop.loop.Handle._run\n File "/home/zenv/.cache/pypoetry/virtualenvs/wl-wallet-py3.7/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 140, in connection_lost\n self.flow.resume_writing()
Environment
- Python: 3.7
What Broke
SSL termination failed, resulting in connection errors and inability to serve requests.
Why It Broke
The flow object was None, causing an AttributeError when attempting to resume writing
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.11.4 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/416
First fixed release: 0.11.4
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
- Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.11.4 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.