Skip to content
MtrXTools

requests.exceptions.ConnectTimeout

Python couldn't open the connection in time

Seen in Python requests, urllib3 (ConnectTimeoutError)

No TCP connection could be set up within the connect timeout, so no request was ever sent.

Common causes

  • A firewall or security group silently drops packets to the port.
  • The host is down or the address is wrong.
  • Outbound traffic must go through a proxy that is not configured.
  • The name resolves to an IPv6 address that is unreachable from this network.

How to fix it

  1. Check the port is reachable from the same machine.
  2. Check firewall rules and security groups on both sides.
  3. Set HTTPS_PROXY if your network requires a proxy.
  4. Use a (connect, read) timeout tuple so connect failures surface quickly.
Check the port from outside

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

Related errors

All 32 Languages & runtimes errors