ETIMEDOUT
Linux / POSIXERRORNotableNetworkHIGH confidence

Connection Timed Out

What this means

A network operation exceeded its timeout before completing. Unlike ECONNREFUSED, a timeout means packets were sent but no response was received — typically because a firewall is silently dropping packets or the remote host is unreachable.

Why it happens
  1. 1A firewall is dropping packets silently (DROP rule instead of REJECT).
  2. 2The remote host is physically unreachable or powered off.
  3. 3Network routing issues prevent packets from reaching the destination.
  4. 4The remote service is overloaded and not responding within the timeout period.
How to reproduce

Connecting to a host behind a DROP firewall rule.

trigger — this will error
trigger — this will error
$ curl --max-time 10 http://192.168.1.100:8080
curl: (28) Connection timed out after 10001 milliseconds

expected output

curl: (28) Connection timed out after 10001 milliseconds

Fix

Diagnose with ping and traceroute

WHEN To determine where in the network path the problem occurs

Diagnose with ping and traceroute
# Test basic reachability
ping -c 4 192.168.1.100

# Trace the network path
traceroute 192.168.1.100

# Check firewall rules (if you control the target)
sudo iptables -L -n | grep DROP

Why this works

ping reveals if the host is reachable at the IP level. traceroute shows where in the path packets are lost.

Sources
Official documentation ↗

Linux Programmer Manual errno(3)

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Linux / POSIX errors