$SNAP_USER_COMMON empty when getent cannot be found in $PATH
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
This seems to be a regression when changing how user data directories are built, as it works on Jammy (snapd 2.63+22.
If getent can't be found in $PATH when running a snap, snapd will output a warning:
2024/12/03 15:17:52.136805 cmd_run.go:1276: WARNING: cannot create user data directory: cannot get the current user: getent could not be executed: exec: "getent": executable file not found in $PATH
and then set the SNAP_USER_COMMON environment variable to be empty (or maybe not set it?)
This means that an app that depends on $SNAP_USER_COMMON (e.g. charmcraft: https:/
To reproduce:
sudo snap install --classic charmcraft --channel=
echo '$SNAP/bin/python -c "from charmcraft import env; print(env.
Expected behaviour occurs on jammy: https:/
Actual behaviour on noble: https:/
description: | updated |
summary: |
- $SNAP_USER_COMMON incorrect when getent cannot be found in $PATH + $SNAP_USER_COMMON empty when getent cannot be found in $PATH |
This does not appear to break on 25.04 with snapd 2.66.1+25.04:
$ echo '$SNAP/bin/python -c "from charmcraft import env; print(env. get_host_ shared_ cache_path( ))"' | PATH=/snap/bin /usr/bin/snap run --shell charmcraft_2 snap/charmcraft _2/common/ cache/charmcraf t
/home/lengau/