Skip to content

Slightly misleading error message on missing user session, not missing subuid/subgid #700

@danishprakash

Description

@danishprakash

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:

if errors.Is(err, syscall.EINVAL) {
return fmt.Errorf(`potentially insufficient UIDs or GIDs available in the user namespace (requested %d:%d for %s): Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": %w`, uid, gid, path, err)
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions