Max retries exceeded with url
requests gave up connecting to the URL
Seen in Python requests, urllib3 (MaxRetryError, requests.exceptions.ConnectionError)
urllib3 could not get a response after its retries; the real error is in the "Caused by" part of the message.
Common causes
- "NameResolutionError" or "Name or service not known": the hostname does not resolve.
- "Connection refused" or "timed out": nothing is listening, or a firewall blocks the port.
- "SSLError": a certificate or TLS handshake problem.
- "ProxyError": the configured proxy is unreachable or rejected the request.
How to fix it
- Read the "Caused by ..." text at the end of the message and fix that underlying error.
- Check the host and port in "HTTPSConnectionPool(host=..., port=...)" are what you expect.
- Check HTTP_PROXY, HTTPS_PROXY and NO_PROXY in the environment.
- Test the same URL with curl from the same machine or container.
Got a different message? Paste it into the error explainer.
Related errors
- http.client.RemoteDisconnected: Remote end closed connection without response · The server closed the connection without replying
- javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) · Java has no TLS version it may use with this server
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed · Python couldn't verify the server's certificate
- certificate verify failed: Hostname mismatch, certificate is not valid for · The certificate doesn't cover this hostname
- socket.gaierror: [Errno -2] Name or service not known · Python couldn't resolve the hostname
- socket.gaierror: [Errno -3] Temporary failure in name resolution · Python couldn't reach a DNS resolver
- requests.exceptions.ConnectTimeout · Python couldn't open the connection in time
- requests.exceptions.ReadTimeout · The server took too long to respond
- ConnectionRefusedError: [Errno 111] Connection refused · Nothing is listening on that port
- PKIX path building failed · Java can't build a trusted certificate chain
- javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure · The server rejected the TLS handshake
- java.net.UnknownHostException · Java couldn't resolve the hostname