Jump to solution
Verify

The Fix

pip install urllib3==1.26.15

Based on closed urllib3/urllib3 issue #2171 · 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
@@ -9,6 +9,7 @@ import concurrent.futures import contextlib +import errno import logging import os
repro.py
==================================== ERRORS ==================================== ______________ ERROR at setup of TestRetryAfter.test_retry_after _______________ Traceback (most recent call last): File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 141, in setup_class cls._start_server() File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 129, in _start_server app, cls.io_loop, cls.certs, cls.scheme, cls.host File "/home/runner/work/urllib3/urllib3/dummyserver/server.py", line 182, in run_tornado_app sockets = tornado.netutil.bind_sockets(None, address=host) File "/home/runner/work/urllib3/urllib3/.nox/test-3-7/lib/python3.7/site-packages/tornado/netutil.py", line 161, in bind_sockets sock.bind(sockaddr) OSError: [Errno 98] Address already in use
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\npip install urllib3==1.26.15\nWhen NOT to use: This fix should not be used in environments where socket binding behavior is critical and cannot tolerate retries.\n\n

Why This Fix Works in Production

  • Trigger: ==================================== ERRORS ====================================
  • Mechanism: The bind_sockets call fails due to the requested address being already in use in crowded CI environments
  • Why the fix works: Adds a retry loop to the bind_sockets call to handle the EADDRINUSE error, which occurs when the requested address is already in use. (first fixed release: 1.26.15).
Production impact:
  • If left unfixed, retry loops can amplify load and turn a small outage into a cascade (thundering herd).

Why This Breaks in Prod

  • Shows up under Python 3.7 in real deployments (not just unit tests).
  • The bind_sockets call fails due to the requested address being already in use in crowded CI environments
  • Surfaces as: ==================================== ERRORS ====================================

Proof / Evidence

  • GitHub issue: #2171
  • Fix PR: https://github.com/urllib3/urllib3/pull/2884
  • First fixed release: 1.26.15
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.95
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.46

Discussion

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

“I'm ++ on a retry loop for bind_sockets, easy fix that will likely work too.”
@sethmlarson · 2021-03-08 · source

Failure Signature (Search String)

  • ==================================== ERRORS ====================================

Error Message

Stack trace
error.txt
Error Message ------------- ==================================== ERRORS ==================================== ______________ ERROR at setup of TestRetryAfter.test_retry_after _______________ Traceback (most recent call last): File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 141, in setup_class cls._start_server() File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 129, in _start_server app, cls.io_loop, cls.certs, cls.scheme, cls.host File "/home/runner/work/urllib3/urllib3/dummyserver/server.py", line 182, in run_tornado_app sockets = tornado.netutil.bind_sockets(None, address=host) File "/home/runner/work/urllib3/urllib3/.nox/test-3-7/lib/python3.7/site-packages/tornado/netutil.py", line 161, in bind_sockets sock.bind(sockaddr) OSError: [Errno 98] Address already in use

Minimal Reproduction

repro.py
==================================== ERRORS ==================================== ______________ ERROR at setup of TestRetryAfter.test_retry_after _______________ Traceback (most recent call last): File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 141, in setup_class cls._start_server() File "/home/runner/work/urllib3/urllib3/dummyserver/testcase.py", line 129, in _start_server app, cls.io_loop, cls.certs, cls.scheme, cls.host File "/home/runner/work/urllib3/urllib3/dummyserver/server.py", line 182, in run_tornado_app sockets = tornado.netutil.bind_sockets(None, address=host) File "/home/runner/work/urllib3/urllib3/.nox/test-3-7/lib/python3.7/site-packages/tornado/netutil.py", line 161, in bind_sockets sock.bind(sockaddr) OSError: [Errno 98] Address already in use

Environment

  • Python: 3.7

What Broke

GitHub Actions fails to start tests due to socket binding errors, causing CI job failures.

Why It Broke

The bind_sockets call fails due to the requested address being already in use in crowded CI environments

Fix Options (Details)

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

pip install urllib3==1.26.15

When NOT to use: This fix should not be used in environments where socket binding behavior is critical and cannot tolerate retries.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/urllib3/urllib3/pull/2884

First fixed release: 1.26.15

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 in environments where socket binding behavior is critical and cannot tolerate retries.

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

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.
  • Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
  • Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.

Version Compatibility Table

VersionStatus
1.26.15 Fixed

Related Issues

No related fixes found.

Sources

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