Skip to content

Report why user namespace setup fails - #81

Merged
jhuntwork merged 1 commit into
mainfrom
report-user-namespace-failures
Nov 3, 2026
Merged

jhuntwork merged 1 commit into
mainfrom
report-user-namespace-failures

Conversation

@jhuntwork

Copy link
Copy Markdown
Owner

When the environment refused the user namespace mapping, mere shell
printed "unknown error" with the detail "failed to write uid_map". The
failing operation, the path and the errno were dropped at the call, and
nothing said the profile and packages were untouched.

Pass the Context to enterEnv, forkAndEnterEnv and the namespace runner
instead of a bare allocator, so namespace setup can report through it.
unshare, the uid_map and gid_map writes now set a subject and details
naming the operation and the cause. EPERM, EACCES and ENOSPC (the
max_user_namespaces limit) add that the environment is restricting user
namespaces and that profiles and packages are not affected. The shell
command keeps these details and uses its static text only as a fallback.
Add friendly messages for UnshareError, UidMapError and GidMapError.

Only the shell path carries the details to the user. The build path runs
setup in a forked child and still reports the error name alone.

Refs #66

When the environment refused the user namespace mapping, mere shell
printed "unknown error" with the detail "failed to write uid_map". The
failing operation, the path and the errno were dropped at the call, and
nothing said the profile and packages were untouched.

Pass the Context to enterEnv, forkAndEnterEnv and the namespace runner
instead of a bare allocator, so namespace setup can report through it.
unshare, the uid_map and gid_map writes now set a subject and details
naming the operation and the cause. EPERM, EACCES and ENOSPC (the
max_user_namespaces limit) add that the environment is restricting user
namespaces and that profiles and packages are not affected. The shell
command keeps these details and uses its static text only as a fallback.
Add friendly messages for UnshareError, UidMapError and GidMapError.

Only the shell path carries the details to the user. The build path runs
setup in a forked child and still reports the error name alone.

Refs #66
@jhuntwork
jhuntwork force-pushed the report-user-namespace-failures branch from 8501b01 to ca586cd Compare November 3, 2026 03:01
@jhuntwork
jhuntwork merged commit d874493 into main Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant