When a user runs rootless podman without a proper login session, image pull fails with:
unpacking failed (error: exit status 1; output:
potentially insufficient UIDs or GIDs available in user namespace (requested 0:42 for /etc/gshadow):
Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": lchown /etc/gshadow: invalid argument)
Even though it says "potentially", we can perhaps improve the error message in cases where the subuid/subgid mappings exist for the user. This happens when fchownat fails with EINVAL:
https://github.com/containers/container-libs/blob/e70c309aabae7d35bf386ff0165ef8c6315a5e26/storage/pkg/chunked/filesystem_linux.go#L175-L177
We could check for a user session similar to what c/common does(bus check) before printing an error message that instead suggests running loginctl enable-linger <uid> as the fix.
When a user runs rootless podman without a proper login session, image pull fails with:
Even though it says "potentially", we can perhaps improve the error message in cases where the subuid/subgid mappings exist for the user. This happens when
fchownatfails withEINVAL:https://github.com/containers/container-libs/blob/e70c309aabae7d35bf386ff0165ef8c6315a5e26/storage/pkg/chunked/filesystem_linux.go#L175-L177
We could check for a user session similar to what c/common does(bus check) before printing an error message that instead suggests running
loginctl enable-linger <uid>as the fix.