Broken pipe
Wrote to a connection or pipe that was already closed
Seen in Linux and macOS (EPIPE, errno 32), shells and pipelines, ssh, rsync
The program wrote to a socket or pipe after the other end had already closed it.
Common causes
- The remote side closed the connection (timeout, crash or restart) while this side was still sending.
- An idle connection was dropped by a firewall, load balancer or NAT, and the next write failed; common with idle SSH sessions.
- In a shell pipeline, the reading command exited early (for example `| head`), which is usually harmless.
How to fix it
- Check the peer's logs for why it closed the connection, such as size limits or idle timeouts.
- For idle connections, enable keepalives: `ServerAliveInterval 60` in ~/.ssh/config, or TCP keepalive in the application.
- Handle the error and reconnect instead of crashing, and keep client idle timeouts shorter than the server's or load balancer's.
Got a different message? Paste it into the error explainer.
Related errors
- Software caused connection abort · Your own system aborted the connection
- Destination host unreachable. · No path to the host could be found
- TTL expired in transit. · Packets ran out of hops before arriving
- PING: transmit failed. General failure. · Windows could not send the ping at all
- Packet needs to be fragmented but DF set. · The packet is bigger than the path MTU
- ECONNREFUSED · Connection refused
- ETIMEDOUT · Connection timed out
- ECONNRESET · Connection reset by peer
- EHOSTUNREACH · No route to host
- getaddrinfo ENOTFOUND · The hostname doesn't exist in DNS
- getaddrinfo EAI_AGAIN · Temporary DNS failure
- ENETUNREACH · Network is unreachable