The Fix
Upgrade to version 0.15.0 or later.
Based on closed Kludex/uvicorn issue #1306 · 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%.
@@ -1,8 +1,10 @@
import logging
import signal
+import sys
from typing import Any
import logging
import asyncio
from typing import Callable
from fastapi import FastAPI
from app.core.config import settings
from app.workers.zeebe_worker import worker
logger = logging.getLogger(__name__)
def create_start_app_handler(_: FastAPI) -> Callable:
async def start_app() -> None:
logging.basicConfig(level=settings.LOGGING_LEVEL)
logger.info('Triggering events on app start')
task = asyncio.create_task(worker.work())
logger.info('created task')
logger.info(f'created task {task}')
return start_app
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.15.0 or later.\nWhen NOT to use: This fix should not be applied if the application does not use Uvicorn workers.\n\n
Why This Fix Works in Production
- Trigger: Regression (?) with uvicorn workers
- Mechanism: The Uvicorn worker exits with a status of 3 when startup events fail
- Why the fix works: Addresses an issue where the Uvicorn worker exits with a status of 3 when startup events fail, preventing infinite start/stop cycles. (first fixed release: 0.15.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
- Shows up under Python 3.7 in real deployments (not just unit tests).
- The Uvicorn worker exits with a status of 3 when startup events fail
- Production symptom (often without a traceback): Regression (?) with uvicorn workers
Proof / Evidence
- GitHub issue: #1306
- Fix PR: https://github.com/encode/uvicorn/pull/1077
- First fixed release: 0.15.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.58
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Closing as there was no response from author. For others coming here, please open a discussion about it, with a minimal reproducible code, so we…”
“It doesn't look like related to the PR mentioned. Do you still have the issue?”
“Yes I do. Could it be an issue how I start an asynchronous worker in an already asynchronous function (start_app())? The interesting behavior is though…”
“A couple of months and bumps happened. Is this still relevant @gabac ?”
Failure Signature (Search String)
- Regression (?) with uvicorn workers
- I'm currently upgrading the version of our application and have since encountered a regression while moving from `uvicorn` `0.14.0` to `0.15.0`
Copy-friendly signature
Failure Signature
-----------------
Regression (?) with uvicorn workers
I'm currently upgrading the version of our application and have since encountered a regression while moving from `uvicorn` `0.14.0` to `0.15.0`
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Regression (?) with uvicorn workers
I'm currently upgrading the version of our application and have since encountered a regression while moving from `uvicorn` `0.14.0` to `0.15.0`
Minimal Reproduction
import logging
import asyncio
from typing import Callable
from fastapi import FastAPI
from app.core.config import settings
from app.workers.zeebe_worker import worker
logger = logging.getLogger(__name__)
def create_start_app_handler(_: FastAPI) -> Callable:
async def start_app() -> None:
logging.basicConfig(level=settings.LOGGING_LEVEL)
logger.info('Triggering events on app start')
task = asyncio.create_task(worker.work())
logger.info('created task')
logger.info(f'created task {task}')
return start_app
Environment
- Python: 3.7
What Broke
Application fails to establish a connection to Zeebe during startup.
Why It Broke
The Uvicorn worker exits with a status of 3 when startup events fail
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.15.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/1077
First fixed release: 0.15.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the application does not use Uvicorn workers.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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.15.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.