Skip to content
MtrXTools

http.client.RemoteDisconnected: Remote end closed connection without response

The server closed the connection without replying

Seen in Python http.client, urllib, requests ("('Connection aborted.', RemoteDisconnected(...))")

Python sent the request but the server closed the connection before any HTTP response arrived.

Common causes

  • The server or a proxy closed a keep-alive connection just as it was reused.
  • The server crashed or timed out while handling the request.
  • A WAF or bot protection drops requests it considers automated.
  • Plain HTTP sent to a port that expects TLS.

How to fix it

  1. Retry idempotent requests with urllib3 Retry on a requests Session.
  2. Check server and proxy logs at the time of the request.
  3. Check the URL scheme and port match.
  4. If a WAF is blocking you, use an API intended for programmatic access or ask the site owner.

Got a different message? Paste it into the error explainer.

Related errors

All 32 Languages & runtimes errors