HTTP: Max retries exceeded with url
Last verified
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /page (Caused by NewConnectionError("<urllib3.connection.HTTPSConnection object at 0x7f...>: Failed to establish a new connection: [Errno 111] Connection refused"))What it means
This message comes from urllib3, the library under requests. It means urllib3 gave up on the URL, but the important part is the text after Caused by, which names the real failure. By default requests performs no retries at all, so "max retries exceeded" usually means the first attempt failed.
The common causes in the parentheses are: NewConnectionError ... Name or service not known or getaddrinfo failed (DNS could not resolve the host), Connection refused (nothing listening on that port), ConnectTimeoutError (no answer at all), SSLError (TLS problem), ProxyError (proxy problem), and ResponseError('too many 429 error responses') or similar when a Retry policy with status_forcelist ran out of attempts.
What is not wrong: nothing until you read the cause; the outer message is generic.
What it looks like
try:
requests.get("https://example.com/page", timeout=(5, 30))
except requests.exceptions.ConnectionError as e:
print(e.args[0].reason) # the underlying causeWhy it happens
- DNS failure: typo in the hostname, or no internet or DNS in the container.
- Nothing listening on the target host and port, or a firewall blocking outbound traffic.
- Timeouts because the host is down or silently dropping connections from your IP.
- TLS or proxy errors wrapped inside the retry error.
- A configured Retry policy exhausted its attempts on 429 or 5xx responses.
How to fix it
- Read the "Caused by" section and jump to the matching fix.
- For DNS errors, check the hostname and run nslookup from the same machine or container.
- For connection refused or timeouts, test with curl -v from the same environment.
- For SSLError or ProxyError, see the certificate and proxy entries.
- If the cause is repeated 429 or 503 responses, slow down and honor Retry-After instead of increasing retries.
- Always pass a timeout, so a dead host fails fast instead of hanging.
How to stop it recurring
Set explicit connect and read timeouts, configure retries only for idempotent requests and only for transient causes, and log the underlying reason rather than the wrapper text.
Official documentation: urllib3.readthedocs.io/en/stable/reference/urllib3.exceptions.html. See all HTTP error messages.
Related errors
- ConnectionResetError: Connection reset by peerrequests.exceptions.ConnectionError: ('Connection aborted.',…
- SSL: CERTIFICATE_VERIFY_FAILEDssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate…
- 407 Proxy Authentication RequiredProxyError('Unable to connect to proxy', OSError('Tunnel connection failed:…
- 429 Too Many Requestsrequests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url:…
Definitions
- CAPTCHACAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a challenge-response m
- Cloudflare Bot ManagementCloudflare Bot Management is the set of Cloudflare features (Bot Fight Mode, Super Bot Fight Mode and the Ente
- DataDomeDataDome is a commercial bot-protection service that scores every request to a website, app or API in real tim
- HUMAN Security (PerimeterX)PerimeterX, now HUMAN Security's Bot Defender after a 2022 merger, is a bot-protection service that scores eve
- User AgentA user agent is a string that browsers send with every HTTP request identifying the browser type, version, and
- AI Web ScraperAn AI web scraper is an AI-powered data extraction tool that understands page structure, identifies relevant d
- Data ScrapingData scraping is the broad practice of programmatically extracting data from any digital source — websites, ap
- Web CrawlerA web crawler (also called a spider or bot) is a program that systematically browses the internet by following
Quick answers
What does "Max retries exceeded with url" mean in HTTP?
This message comes from urllib3, the library under requests. It means urllib3 gave up on the URL, but the important part is the text after Caused by , which names the real failure. By default requests performs no retries at all, so "max retries exceeded" usually means the first attempt failed. The common causes in the parentheses are: NewConnectionError ...
How do I fix "Max retries exceeded with url"?
1. Read the "Caused by" section and jump to the matching fix. 2. For DNS errors, check the hostname and run nslookup from the same machine or container. 3. For connection refused or timeouts, test with curl -v from the same environment. 4. For SSLError or ProxyError, see the certificate and proxy entries. 5. If the cause is repeated 429 or 503 responses, slow down and honor Retry-After instead of increasing retries. 6. Always pass a timeout, so a dead host fails fast instead of hanging.
Retries and timeouts without writing the loop
Autonoly's HTTP Request node and browser steps have per-node retries, timeouts and continue-on-fail, so a transient 429 or 503 can back off instead of failing the run. It has no proxies or IP rotation: if a site blocks automated traffic, that block applies to Autonoly too.
Also see Error handling in workflows.