Jump to solution
Verify

The Fix

Upgrade to version 0.18.0 or later.

Based on closed Kludex/uvicorn issue #1317 · 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%.

Jump to Verify Open PR/Commit
@@ -544,3 +544,22 @@ def test_bind_fd_works_with_reload_or_workers(reload, workers): # pragma: py-wi sock.close() fdsock.close() + + [email protected](
repro
the bug
verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.18.0 or later.\nWhen NOT to use: This fix should not be used if the application requires specific socket handling for multiple workers.\n\n

Why This Fix Works in Production

  • Trigger: OSError occurs when workers > 1
  • Mechanism: The OSError occurs due to incorrect handling of sockets when using multiple workers on Windows
  • Why the fix works: Fix OSError: [WinError 87] The parameter is incorrect by forcing the loop in windows when workers > 1. (first fixed release: 0.18.0).
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.8.10 in real deployments (not just unit tests).
  • The OSError occurs due to incorrect handling of sockets when using multiple workers on Windows
  • Surfaces as: Traceback (most recent call last):\n File "C:\Users\phanm\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 834, in loop\n f =…

Proof / Evidence

  • GitHub issue: #1317
  • Fix PR: https://github.com/kludex/uvicorn/pull/1454
  • First fixed release: 0.18.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.64

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“can confirm I boote a win box, the app seems functional though just with this error message note that running from the CLI you dont…”
@euri10 · 2022-02-17 · source
“maybe the issue is that in the multiprocess case we dont call Server.startup but Server.serve directly, and iirc in startup method we have something to…”
@euri10 · 2022-02-17 · source
“This seemed to fix this issue for me Pull Request #1443”
@smitchell6879 · 2022-04-06 · source
“I have this problem as well - reload=True with workers >= 2 removes the error”
@grahamrjuk · 2022-01-14 · source

Failure Signature (Search String)

  • OSError occurs when workers > 1

Error Message

Stack trace
error.txt
Error Message ------------- Traceback (most recent call last):\n File "C:\Users\phanm\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 834, in loop\n f = self._proactor.accept(sock)\n File "C:\Users\phanm\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 549, in accept\n self._register_with_iocp(listener)\n File "C:\Users\phanm\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 718, in _register_with_iocp\n _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)

Minimal Reproduction

  1. the bug

Environment

  • Python: 3.8.10

What Broke

Multiple OSError messages appear when starting the server with more than one worker.

Why It Broke

The OSError occurs due to incorrect handling of sockets when using multiple workers on Windows

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

Upgrade to version 0.18.0 or later.

When NOT to use: This fix should not be used if the application requires specific socket handling for multiple workers.

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/1454

First fixed release: 0.18.0

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

  • This fix should not be used if the application requires specific socket handling for multiple workers.

Verify Fix

verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.

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

VersionStatus
0.18.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.