{"record":{"id":"fb7fdba32ba7b190","repo":"podman-container-tools/podman","slug":"cannot-write-to-pipe-m","errorCode":null,"errorMessage":"cannot write to pipe: %m\n","messagePattern":"cannot write to pipe: %m\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rootless/rootless_linux.c","lineNumber":1077,"sourceCode":"              fprintf (stderr, \"cannot write to file descriptor: %m\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n          close (fd);\n\n          /* There can be another process at this point trying to configure the user namespace and the pause\n           process, do not override the pid file if it already exists. */\n          if (rename_noreplace (AT_FDCWD, tmp_file_path, AT_FDCWD, pause_pid_file_path) < 0)\n            {\n              unlink (tmp_file_path);\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n\n          r = TEMP_FAILURE_RETRY (write (p[1], \"0\", 1));\n          if (r < 0)\n            {\n              fprintf (stderr, \"cannot write to pipe: %m\\n\");\n              _exit (EXIT_FAILURE);\n            }\n          close (p[1]);\n\n          _exit (EXIT_SUCCESS);\n        }\n      else\n        {\n          int null;\n\n          close (p[1]);\n\n          null = open (\"/dev/null\", O_RDWR);\n          if (null >= 0)\n            {\n              dup2 (null, 0);\n              dup2 (null, 1);\n              dup2 (null, 2);","sourceCodeStart":1059,"sourceCodeEnd":1095,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/pkg/rootless/rootless_linux.c#L1059-L1095","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# no meaningful pre-check: this write only fails after the parent already died\n# keep the parent healthy instead:\nulimit -v unlimited 2>/dev/null; cat /sys/fs/cgroup/memory.max 2>/dev/null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["podman","rootless","pause-process","pipe","race-condition"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}