python
network_error
ai_generated
true
TimeoutError: [Errno 110] Connection timed out
ID: python/timeouterror
80%Fix Rate
82%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 311 | active | — | — | — |
Root Cause
Network connection or operation timed out.
genericWorkarounds
-
90% success Add retry with exponential backoff for transient failures
import tenacity @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), stop=tenacity.stop_after_attempt(5)) def fetch_with_retry(url): return urllib.request.urlopen(url, timeout=10).read()Sources: https://docs.python.org/3/library/urllib.request.html
-
88% success Verify target host is reachable: DNS, firewall, port
DNS, firewall, port
Sources: https://docs.python.org/3/library/socket.html#socket.create_connection
Dead Ends
Common approaches that don't work:
-
Increase timeout to very large value
65% fail
Just delays the failure, doesn't fix the network issue
-
Remove timeout entirely
85% fail
Process hangs forever on unreachable hosts
Error Chain
Frequently confused with: