{"record":{"id":"7b2e91032fe666da","repo":"podman-container-tools/podman","slug":"cannot-write-to-file-descriptor-m","errorCode":null,"errorMessage":"cannot write to file descriptor: %m\n","messagePattern":"cannot write to file descriptor: %m\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rootless/rootless_linux.c","lineNumber":1059,"sourceCode":"          if (tmp_file_path == NULL)\n            {\n              fprintf (stderr, \"temporary file path is NULL\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n\n          fd = mkstemp (tmp_file_path);\n          if (fd < 0)\n            {\n              fprintf (stderr, \"error creating temporary file: %m\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n\n          r = TEMP_FAILURE_RETRY (write (fd, pid_str, strlen (pid_str)));\n          if (r < 0)\n            {\n              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\");","sourceCodeStart":1041,"sourceCodeEnd":1077,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/pkg/rootless/rootless_linux.c#L1041-L1077","documentation":"Emitted by the intermediate child inside create_pause_process (pkg/rootless/rootless_linux.c:975): after mkstemp created state_dir/pause.pid.XXXXXX, the write() of the pause process PID into that temp file failed. EINTR is already retried via TEMP_FAILURE_RETRY, so the errno printed by %m comes from write(2) itself (typically ENOSPC/EDQUOT/EIO). The child kills the pause child and _exit(EXIT_FAILURE)s, which makes create_pause_process return -1 and aborts the whole rootless re-exec.","triggerScenarios":"The pause-process path is taken (get_and_save_ns_handles_with_lock failed with EOPNOTSUPP/EPERM/ENOSYS/ENOENT, or PODMAN_NO_PAUSE_PROCESS is unset/0) and write() on the freshly created temp file returns < 0: filesystem holding state_dir is full (ENOSPC), quota exceeded (EDQUOT), I/O error on failing disk or NFS (EIO/ESTALE).","commonSituations":"tmpfs /run/user/$UID filled by leaked pause processes and large files during long-running `podman system service`; home-directory quota on shared/enterprise machines; NFS home with transient faults.","solutions":["Check free space and quotas on the state dir and its filesystem: df -h \"$XDG_RUNTIME_DIR\" ~/.local/share/containers; free space or raise the quota","Clean leaked pause processes and stale pause.pid files: pkill -f _PODMAN_PAUSE; then re-run the command","Export PODMAN_NO_PAUSE_PROCESS=1 to use nsfs namespace handles instead of a pause process (no pid file writes)","If %m shows EIO/ESTALE, check dmesg and the health of the underlying disk/NFS export"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# before starting rootless podman / podman system service\ndir=\"${XDG_RUNTIME_DIR:-/run/user/$(id -u)}\"\nfor d in \"$dir\" \"$HOME/.local/share/containers\"; do\n  [ -d \"$d\" ] && [ -w \"$d\" ] || { echo \"state dir not writable: $d\"; exit 1; }\ndone\ndf -h \"$HOME\" \"$dir\" | awk 'NR==1 || $5+0 > 90 {print}'  # ensure free space","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor free space on the filesystem holding the rootless state dir; pause.pid writes fail hard when it is full","Periodically clean leaked pause processes: pkill -f _PODMAN_PAUSE (they carry _PODMAN_PAUSE=1 in their environment)","Set PODMAN_NO_PAUSE_PROCESS=1 on kernels with nsfs handle support to avoid pause-process pid-file writes entirely"],"tags":["podman","rootless","pause-process","disk-space","cgo"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}