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

  1. 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
  2. Clean leaked pause processes and stale pause.pid files: pkill -f _PODMAN_PAUSE; then re-run the command
  3. Export PODMAN_NO_PAUSE_PROCESS=1 to use nsfs namespace handles instead of a pause process (no pid file writes)
  4. 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

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


AI-assisted analysis of podman-container-tools/podman@a2409076ef (2026-08-15). Data as JSON: /api/errors/7b2e91032fe666da. Report an issue: GitHub.