podman-container-tools/podman · error

cannot read argv: %m

Error message

cannot read argv: %m

What it means

In reexec_userns_join, get_cmd_line_args(NULL) returned NULL. That helper reads /proc/self/cmdline to rebuild argv, which is later passed to execvp("/proc/self/exe", argv) in the joined namespace. The message is printed with %m, pointing at the open/read of /proc/self/cmdline (or an allocation failure inside the helper), and the process _exit(EXIT_FAILURE)s.

Source

Thrown at pkg/rootless/rootless_linux.c:1138

  cleanup_free char *argv0 = NULL;
  cleanup_free char **argv = NULL;
  int pid;
  sigset_t sigset, oldsigset;

  cwd = getcwd (NULL, 0);
  if (cwd == NULL)
    {
      fprintf (stderr, "error getting current working directory: %m\n");
      _exit (EXIT_FAILURE);
    }

  sprintf (uid, "%d", geteuid ());
  sprintf (gid, "%d", getegid ());

  argv = get_cmd_line_args (NULL);
  if (argv == NULL)
    {
      fprintf (stderr, "cannot read argv: %m\n");
      _exit (EXIT_FAILURE);
    }

  argv0 = argv[0];

  userns_fd = open_namespace (pid_to_join, "user");
  if (userns_fd < 0)
    return userns_fd;
  mntns_fd = open_namespace (pid_to_join, "mnt");
  if (mntns_fd < 0)
    return mntns_fd;

  pid = fork ();
  if (pid < 0)
    fprintf (stderr, "cannot fork: %m\n");

  if (pid)
    {

View on GitHub (pinned to a2409076ef)

Solutions

  1. Verify /proc is mounted and readable: mount | grep ' /proc ' and test -r /proc/self/cmdline
  2. Inside a sandbox/container, provide a procfs mount: mount -t proc proc /proc
  3. Check memory pressure and dmesg for OOM activity; free memory and retry
Defensive patterns

Strategy: validation

Validate before calling

test -r /proc/self/cmdline || { echo "/proc missing or unreadable - mount procfs"; exit 1; }

Prevention

When it happens

Trigger: /proc is not mounted or is masked (minimal containers, chroot sandboxes without procfs); ENOMEM when malloc for argv fails under heavy memory pressure; procfs mounted with unusual options that make /proc/self/cmdline unreadable.

Common situations: Running podman inside a hand-built sandbox/container without a /proc mount; hosts under extreme memory pressure where the OOM killer is imminent; broken procfs setups after partial container teardown.

Related errors


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