podman-container-tools/podman · error
cannot write to pipe: %m
Error message
cannot write to pipe: %m
What it means
In create_pause_process, after pause.pid was atomically installed via rename_noreplace, the intermediate child writes the one-byte '0' ack to pipe p[1] to release the parent (which blocks in read(p[0]) until the pid file exists). A failed write makes the child _exit(EXIT_FAILURE); the parent then sees r != 1 and returns -1, so rootless setup fails. Because the pipe has no other readers left when the parent dies, the usual errno is EPIPE/EBADF.
Source
Thrown at pkg/rootless/rootless_linux.c:1077
fprintf (stderr, "cannot write to file descriptor: %m\n");
kill (pid, SIGKILL);
_exit (EXIT_FAILURE);
}
close (fd);
/* There can be another process at this point trying to configure the user namespace and the pause
process, do not override the pid file if it already exists. */
if (rename_noreplace (AT_FDCWD, tmp_file_path, AT_FDCWD, pause_pid_file_path) < 0)
{
unlink (tmp_file_path);
kill (pid, SIGKILL);
_exit (EXIT_FAILURE);
}
r = TEMP_FAILURE_RETRY (write (p[1], "0", 1));
if (r < 0)
{
fprintf (stderr, "cannot write to pipe: %m\n");
_exit (EXIT_FAILURE);
}
close (p[1]);
_exit (EXIT_SUCCESS);
}
else
{
int null;
close (p[1]);
null = open ("/dev/null", O_RDWR);
if (null >= 0)
{
dup2 (null, 0);
dup2 (null, 1);
dup2 (null, 2);View on GitHub (pinned to a2409076ef)
Solutions
- Scroll up and fix the FIRST error printed before this one; this write failure is a downstream symptom
- Re-run the podman command; a one-off parent-death race is transient
- Check for OOM kills or manual kills of podman processes around the failure time: journalctl -k | grep -i oom
Defensive patterns
Strategy: validation
Validate before calling
# no meaningful pre-check: this write only fails after the parent already died # keep the parent healthy instead: ulimit -v unlimited 2>/dev/null; cat /sys/fs/cgroup/memory.max 2>/dev/null
Prevention
- Treat this message as a symptom: always investigate the first error above it in the log
- Protect the parent podman process from OOM kills (MemoryMax settings, swap) so pipe peers stay alive
- Avoid manually SIGKILLing the podman re-exec chain; let commands finish
When it happens
Trigger: The parent side of create_pause_process already exited and closed p[0] (race when the parent is killed, or reexec_in_user_namespace_wait reaped it first), so write(p[1], "0", 1) fails with EPIPE; EIO on a broken pipe device is not expected. This message is almost always a symptom following another, earlier failure.
Common situations: System under memory pressure where the parent is OOM-killed; manual kill of the podman re-exec chain; usually appears together with another error message above it in the log.
Related errors
- cannot write to file descriptor: %m
- cannot save namespace handles: %m
- cannot set %s namespace
- pause.pid file refers to PID %ld which is not a pause proces
- unable to print to string
AI-assisted analysis of podman-container-tools/podman@a2409076ef (2026-08-15).
Data as JSON: /api/errors/fb7fdba32ba7b190.
Report an issue: GitHub.