ERRO[0000] invalid internal status, try resetting the pause process with "podman system migrate": setting up the process: open libpod/tmp/pause.pid: no such file or directory #22327
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
Rootless podman nested inside rootless podman running as root user is creating libpod/tmp/pause.pid in current working directory, if the working directory is then changed further invocations of podman fail because it cannot find this file
Steps to reproduce the issue
Simplified steps to show the problem. /etc/subuid and /etc/subgid are not setup correctly in this example, and the launch of the outer container is missing flags such as --security-opt label=disable --device /dev/fuse which are required to run nested rooted containers
Note issue only occurs when running as user root in the container. If the container is started with --user , or you switch to another user inside the container then running nested podman commands works as expected.
1. Outer podman version (probably irrelevant, but included for completeness)
podman --version
podman version 4.6.1
2. Start rootless container
podman run -it --rm quay.io/podman/stable:latest /bin/bash
3. Inner podman version
[root@f51a0bb05b3e /]# podman --version
podman version 4.9.4
4. From CWD = dir1 run "podman image ls"
[root@f51a0bb05b3e /]# mkdir ~/dir1 && cd ~/dir1
[root@f51a0bb05b3e dir1]# podman image ls
WARN[0000] Using rootless single mapping into the namespace. This might break some images. Check /etc/subuid and /etc/subgid for adding sub*ids if not using a network user
REPOSITORY TAG IMAGE ID CREATED SIZE
5. Unexpectedly podman has created files in the current working directory
[root@f51a0bb05b3e dir1]# ls -R
.:
libpod
./libpod:
tmp
./libpod/tmp:
pause.pid
6. From CWD = dir2 run "podman image ls"
[root@f51a0bb05b3e dir1]# mkdir ~/dir2 && cd ~/dir2
[root@f51a0bb05b3e dir2]# podman image ls
WARN[0000] Using rootless single mapping into the namespace. This might break some images. Check /etc/subuid and /etc/subgid for adding sub*ids if not using a network user
error creating temporary file: No such file or directory
ERRO[0000] invalid internal status, try resetting the pause process with "podman system migrate": setting up the process: open libpod/tmp/pause.pid: no such file or directory
Describe the results you received
1st invocation of podman created libpod/tmp/pause.pid in current working directroy
Subsequent invocation of podman from a different current working directory then failed to find this file:
ERRO[0000] invalid internal status, try resetting the pause process with "podman system migrate": setting up the process: open libpod/tmp/pause.pid: no such file or directory
Describe the results you expected
Expected podman to create libpod/tmp/pause.pid in a location which could be found by subsequent commands - perhaps /run/libpod/tmp/pause.pid or $XDG_RUNTIME_DIR/libpod/tmp/pause.pid
podman info output
Podman in a container
Yes
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Also tested a container running a development version of podman 5.1 and reproduced the same issue, so fairly confident that this bug hasn't been fixed in newer releases.
Using strace you can see podman creating libpod, libpod/tmp and libpod/tmp/pause.pid with relative pathnames the first time it is run:
#strace -f podman image ls 2>&1 | grep libpod
...
[pid 130] newfstatat(AT_FDCWD, "libpod/tmp", 0xc000649e48, 0) = -1 ENOENT (No such file or directory)
[pid 130] newfstatat(AT_FDCWD, "libpod", 0xc000649f18, 0) = -1 ENOENT (No such file or directory)
[pid 130] mkdirat(AT_FDCWD, "libpod", 0700 <unfinished ...>
[pid 130] mkdirat(AT_FDCWD, "libpod/tmp", 0700 <unfinished ...>
[pid 133] openat(AT_FDCWD, "libpod/tmp/pause.pid.vexbwk", O_RDWR|O_CREAT|O_EXCL, 0600 <unfinished ...>
[pid 133] renameat2(AT_FDCWD, "libpod/tmp/pause.pid.vexbwk", AT_FDCWD, "libpod/tmp/pause.pid", RENAME_NOREPLACE <unfinished ...>
...
Running a second time from a different directory you can see podman fail to find the file using a relative pathname:
#strace -f podman image ls 2>&1 | grep libpod
...
[pid 251] newfstatat(AT_FDCWD, "libpod/tmp/pause.pid", 0xc00050b6f8, 0) = -1 ENOENT (No such file or directory)
[pid 261] openat(AT_FDCWD, "libpod/tmp/pause.pid.x7LxQA", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 ENOENT (No such file or directory)
[pid 251] openat(AT_FDCWD, "libpod/tmp/pause.pid", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 251] write(2, "time="2024-04-10T07:32:31Z" leve"..., 212time="2024-04-10T07:32:31Z" level=error msg="invalid internal status, try resetting the pause process with "podman system migrate": setting up the process: open libpod/tmp/pause.pid: no such file or directory"
Appears to be a bug in how podman is constructing the pathname for this file.
The text was updated successfully, but these errors were encountered: