What it means: Your process wrote data into a socket or pipe whose reading side was already closed.
Free online tool — HTTP status code checker: instant results, no signup.
Requests the address and shows the status code and what the server sends back.
EPIPE («Broken pipe», errno 32 on Linux) is returned by write(2) when the descriptor «is connected to a pipe or socket whose reading end is closed». The same page notes that the writing process also receives a SIGPIPE signal, which kills it by default; the error code is only seen by programs that catch, block or ignore that signal. Node.js ignores SIGPIPE by default (process docs), so it surfaces as an error event instead:
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons) { errno: -32, code: 'EPIPE', syscall: 'write' }The Node.js docs describe it as «A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at the net and http layers, indicative that the remote side of the stream being written to has been closed.» Python raises BrokenPipeError: [Errno 32] Broken pipe; curl reports a send failure (exit code 55, «Failed sending network data»).
EPIPE and ECONNRESET are two views of the same event. If the peer's reset arrives before your next read, you get ECONNRESET; if your next operation is a write to the already-closed socket, you get EPIPE. Which one appears is a matter of timing.
| Situation | Who closed the connection | Fix |
|---|---|---|
| Large upload to an HTTP server | The server rejected the body (for example 413) and closed while the client kept sending | Raise the server limit or upload in parts |
| Writing a long response to a slow or gone client | The browser navigated away or the client timed out | Stop writing on 'close'; treat as normal disconnect |
| Reused keep-alive or database connection | The server dropped the idle connection | Shorter client idle timeout; validate pooled connections |
node script.js | head | head exited after reading enough lines | Handle EPIPE on process.stdout |
| Child process stdin | The child exited before reading all input | Check the child's exit code; handle the stdin error |
| Proxy timeout on a long request | nginx or a load balancer closed after its timeout | Align proxy and app timeouts; stream progress |
On the client side, the most common trigger is an upload the server stops reading. The server answers early with an error status and closes; the client is still pushing the body and hits EPIPE before it ever reads that status. Check the server's body limit first, for nginx client_max_body_size, and read the server log for the same timestamp. A response you never saw because of EPIPE is often a plain 413.
On the server side, EPIPE while writing a response usually means the client left: closed the tab, hit a timeout, or a proxy gave up first. That is normal traffic, not a bug, but an unhandled 'error' event on the stream still crashes a Node.js process. Listen for it and stop producing data:
res.on('close', () => { stream.destroy(); });
stream.on('error', (err) => {
if (err.code === 'EPIPE' || err.code === 'ECONNRESET') return; // client went away
console.error(err);
});
stream.pipe(res);When this happens at a fixed duration on long requests, a proxy in front is closing the connection; see upstream prematurely closed connection for the nginx side.
Command-line tools hit EPIPE when their output is piped into a program that stops reading early. node list.js | head -n 5 works until head exits after line five; the next write to stdout fails. Shell tools written in C are simply killed by SIGPIPE, which is why yes | head exits quietly. In Node.js, end the process cleanly instead of printing a stack trace:
process.stdout.on('error', (err) => {
if (err.code === 'EPIPE') process.exit(0);
throw err;
});curl -v -T big.bin https://api.example.com/upload
# < HTTP/1.1 413 Request Entity Too Largeproxy_read_timeout, the app server) and keep the upstream one longer.'close' has fired.curl -sS -o /dev/null -w '%{http_code}\n' -T big.bin https://api.example.com/upload
# 201Then check application logs over a normal day: EPIPE from clients that disconnect will still occur occasionally and should be logged at debug level, not as crashes. The HTTP status checker shows the status code and headers a URL returns.
HTTP status codes are three-digit numbers that the server returns for every request. They tell the browser and search crawlers what happened: success, redirect, or error.
Enter a code or keyword — instant result with description.
1xx Informational, 2xx Success, 3xx Redirect, 4xx Client Error, 5xx Server Error.
For each code: typical causes and concrete steps to resolve.
How each code affects indexing and link juice transfer in Google.
choosing correct status
redirect optimization
5xx error diagnostics
landing page check
HTTP monitor alerts when response code changes or 5xx appears.
Sign up freeBoth mean the peer closed the connection. You get EPIPE when your next action is a write and ECONNRESET when the reset is noticed on a read.
head exits after reading its lines, so the next write to stdout goes to a closed pipe. Handle the EPIPE error on process.stdout and exit quietly.
The server rejected the body, often with 413, and closed the connection while the client was still sending. Raise the server's body size limit.
No. It usually means a client disconnected. Handle the stream error event, stop writing and log it at a low level.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.