java.net.SocketTimeoutException: Read timed out
The server took too long to send data
Seen in Java, Spring RestTemplate and WebClient, Apache HttpClient, JDBC drivers
The connection was open, but no data arrived within the socket read timeout.
Common causes
- The server or a database behind it is slow or stuck.
- The read timeout is shorter than the request legitimately needs.
- A proxy or load balancer silently dropped an idle connection.
How to fix it
- Measure how long the endpoint takes and set the read timeout above that.
- Check server logs and upstream latency.
- Lower connection pool idle times below the proxy idle timeout, and retry idempotent calls.
Got a different message? Paste it into the error explainer.
Related errors
- requests.exceptions.ReadTimeout · The server took too long to respond
- context deadline exceeded (Client.Timeout exceeded while awaiting headers) · The HTTP client timed out before the response
- [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
- Max retries exceeded with url · requests gave up connecting to the URL
- 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
- ConnectionRefusedError: [Errno 111] Connection refused · Nothing is listening on that port
- http.client.RemoteDisconnected: Remote end closed connection without response · The server closed the connection without replying
- 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