Jump to solution
Verify

The Fix

Upgrade to version 0.11.4 or later.

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

Jump to Verify Open PR/Commit
@@ -5,10 +5,7 @@ def auto_loop_setup(): import uvloop except ImportError as exc: # pragma: no cover - if sys.platform == "win32": - from uvicorn.loops.iocp import iocp_setup as loop_setup - else:
repro.py
INFO: Started server process [19676] ERROR: Accept failed on a socket socket: <asyncio.TransportSocket fd=696, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)> Traceback (most recent call last): File "C:\Users\f\scoop\apps\python\current\lib\asyncio\proactor_events.py", line 817, in loop f = self._proactor.accept(sock) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 545, in accept self._register_with_iocp(listener) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 714, in _register_with_iocp _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0) OSError: [WinError 87] The parameter is incorrect
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.11.4 or later.\nWhen NOT to use: Do not apply this fix if you require uvloop functionality on non-Windows platforms.\n\n

Why This Fix Works in Production

  • Trigger: ERROR: Accept failed on a socket
  • Mechanism: The default event loop on Windows was set to IOCP, causing compatibility issues
  • Why the fix works: Switches the default event loop on Windows from IOCP to Asyncio, addressing the issue where --reload was not functioning properly. (first fixed release: 0.11.4).
Production impact:
  • If left unfixed, retries/timeouts can trigger duplicate external side-effects (double charges, duplicate emails, repeated writes).

Why This Breaks in Prod

  • Shows up under Python 3.8 in real deployments (not just unit tests).
  • The default event loop on Windows was set to IOCP, causing compatibility issues
  • Surfaces as: INFO: Started server process [19676]

Proof / Evidence

  • GitHub issue: #509
  • Fix PR: https://github.com/kludex/uvicorn/pull/513
  • 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.39

Discussion

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

“Is this supposed to now work on Python 3.8 on Windows? Because applying this patch to 0.10.8 doesn't seem to work:”
@f0ff886f · 2019-12-17 · source

Failure Signature (Search String)

  • ERROR: Accept failed on a socket

Error Message

Stack trace
error.txt
Error Message ------------- INFO: Started server process [19676] ERROR: Accept failed on a socket socket: <asyncio.TransportSocket fd=696, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)> Traceback (most recent call last): File "C:\Users\f\scoop\apps\python\current\lib\asyncio\proactor_events.py", line 817, in loop f = self._proactor.accept(sock) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 545, in accept self._register_with_iocp(listener) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 714, in _register_with_iocp _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0) OSError: [WinError 87] The parameter is incorrect

Minimal Reproduction

repro.py
INFO: Started server process [19676] ERROR: Accept failed on a socket socket: <asyncio.TransportSocket fd=696, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)> Traceback (most recent call last): File "C:\Users\f\scoop\apps\python\current\lib\asyncio\proactor_events.py", line 817, in loop f = self._proactor.accept(sock) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 545, in accept self._register_with_iocp(listener) File "C:\Users\f\scoop\apps\python\current\lib\asyncio\windows_events.py", line 714, in _register_with_iocp _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0) OSError: [WinError 87] The parameter is incorrect

Environment

  • Python: 3.8

What Broke

The server fails to accept connections, resulting in service unavailability.

Why It Broke

The default event loop on Windows was set to IOCP, causing compatibility issues

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 apply this fix if you require uvloop functionality on non-Windows platforms.

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

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 apply this fix if you require uvloop functionality on non-Windows platforms.

Verify Fix

verify
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

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