Skip to content
Latchkey

SIGPIPE (Signal 13) in CI: Broken Pipe and Exit 141

SIGPIPE is Unix signal 13, sent when a process writes to a closed pipe. A process killed by it reports exit code 141 (128 + 13).

SIGPIPE is often benign - a classic producer | head where the consumer exits early - but with pipefail it can fail the job and occasionally masks a real downstream crash.

What it means

Signal 13 fires when a process writes to a pipe whose reader has gone away. The default action terminates the writer; the shell reports 141.

When it happens in CI

  • A pipeline consumer (head, grep -q) closed early.
  • A real downstream process crashed mid-stream.
  • set -o pipefail promoted SIGPIPE to a failure.

How to handle it

Decide whether the early close is expected (then ignore it deliberately) or masks a real crash. Handle SIGPIPE in long-running writers, or restructure the pipeline so the consumer reads fully.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →