Jump to solution
Details

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%.

Open PR/Commit
@@ -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()
fix.md
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).
Production impact:
  • 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.”
@Hanaasagi · 2019-09-19 · confirmation · source
“This is resolved in 0.9.1 (if you're using the default httptools), and in master (if you're using h11)”
@lovelydinosaur · 2019-10-29 · confirmation · source
“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”
@Hanaasagi · 2019-09-19 · source
“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…”
@chrisborbidge · 2019-10-18 · source

Failure Signature (Search String)

  • NoneType' object has no attribute 'resume_writing' on SSL termination

Error Message

Stack trace
error.txt
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.

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

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

VersionStatus
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.