podman-container-tools/podman · error
cannot write to file descriptor: %m
Error message
cannot write to file descriptor: %m
What it means
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.
Source
Thrown at pkg/rootless/rootless_linux.c:1059
if (tmp_file_path == NULL)
{
fprintf (stderr, "temporary file path is NULL\n");
kill (pid, SIGKILL);
_exit (EXIT_FAILURE);
}
fd = mkstemp (tmp_file_path);
if (fd < 0)
{
fprintf (stderr, "error creating temporary file: %m\n");
kill (pid, SIGKILL);
_exit (EXIT_FAILURE);
}
r = TEMP_FAILURE_RETRY (write (fd, pid_str, strlen (pid_str)));
if (r < 0)
{
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");View on GitHub (pinned to a2409076ef)
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
Defensive patterns
Strategy: validation
Validate before calling
# before starting rootless podman / podman system service
dir="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
for d in "$dir" "$HOME/.local/share/containers"; do
[ -d "$d" ] && [ -w "$d" ] || { echo "state dir not writable: $d"; exit 1; }
done
df -h "$HOME" "$dir" | awk 'NR==1 || $5+0 > 90 {print}' # ensure free space Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- cannot write to pipe: %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/7b2e91032fe666da.
Report an issue: GitHub.