EHOSTDOWN
Linux / POSIXERRORNotableNetworkHIGH confidence
Host Is Down
Production Risk
Indicates server or host outage; implement retry with exponential backoff.
What this means
EHOSTDOWN (errno 112) is returned when a connect() or send() fails because the remote host is down. This is typically returned by NFS or when an ICMP "Host is down" message is received.
Why it happens
- 1NFS server is powered off or crashed
- 2ICMP destination unreachable (Host is down) received
- 3Remote host not responding to ARP on the local network
How to reproduce
NFS operation when the file server is down.
trigger — this will error
trigger — this will error
// NFS read when server is down ssize_t n = read(nfs_fd, buf, sizeof(buf)); // Returns -1, errno = EHOSTDOWN
expected output
read: Host is down (EHOSTDOWN)
Fix
Verify host is reachable before operating
WHEN After EHOSTDOWN
Verify host is reachable before operating
# Check if host is up ping -c 3 nfs-server # Check NFS service showmount -e nfs-server # Remount after server recovery mount -a
Why this works
EHOSTDOWN is terminal for the operation; wait for the host to recover and reconnect.
Sources
Official documentation ↗
Linux Programmer Manual errno(3)
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev