{"record":{"id":"4bee810c2aaaa9d6","repo":"podman-container-tools/podman","slug":"cannot-read-argv-m","errorCode":null,"errorMessage":"cannot read argv: %m\n","messagePattern":"cannot read argv: %m\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rootless/rootless_linux.c","lineNumber":1138,"sourceCode":"  cleanup_free char *argv0 = NULL;\n  cleanup_free char **argv = NULL;\n  int pid;\n  sigset_t sigset, oldsigset;\n\n  cwd = getcwd (NULL, 0);\n  if (cwd == NULL)\n    {\n      fprintf (stderr, \"error getting current working directory: %m\\n\");\n      _exit (EXIT_FAILURE);\n    }\n\n  sprintf (uid, \"%d\", geteuid ());\n  sprintf (gid, \"%d\", getegid ());\n\n  argv = get_cmd_line_args (NULL);\n  if (argv == NULL)\n    {\n      fprintf (stderr, \"cannot read argv: %m\\n\");\n      _exit (EXIT_FAILURE);\n    }\n\n  argv0 = argv[0];\n\n  userns_fd = open_namespace (pid_to_join, \"user\");\n  if (userns_fd < 0)\n    return userns_fd;\n  mntns_fd = open_namespace (pid_to_join, \"mnt\");\n  if (mntns_fd < 0)\n    return mntns_fd;\n\n  pid = fork ();\n  if (pid < 0)\n    fprintf (stderr, \"cannot fork: %m\\n\");\n\n  if (pid)\n    {","sourceCodeStart":1120,"sourceCodeEnd":1156,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/pkg/rootless/rootless_linux.c#L1120-L1156","documentation":"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.","triggerScenarios":"/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.","commonSituations":"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.","solutions":["Verify /proc is mounted and readable: mount | grep ' /proc ' and test -r /proc/self/cmdline","Inside a sandbox/container, provide a procfs mount: mount -t proc proc /proc","Check memory pressure and dmesg for OOM activity; free memory and retry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"test -r /proc/self/cmdline || { echo \"/proc missing or unreadable - mount procfs\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every sandbox/container that runs podman mounts a procfs at /proc","Watch memory pressure (dmesg | grep -i oom) when running many rootless operations concurrently","Keep /proc mounted with standard options; do not mount it read-only for podman processes"],"tags":["podman","rootless","procfs","userns","memory"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}