Hi, on a Debian trixie system, `guix gc` fails to find garbage collector
roots (with "Permission denied" errors) and then proceeds to delete
virtually everything from the store.

I reinstalled Guix to verify this; here is an approximate transcript.
(The commit pulled is recent, dated 2026-07-12 UTC. I used
`--collect-garbage=0` to prevent required store items from being deleted.)

```console
# ./guix-install.sh # v1.5.0
# guix pull --commit=a8391f2d7451c2463ba253ffa9872fa6f27485d7 # As root
$ guix pull --commit=a8391f2d7451c2463ba253ffa9872fa6f27485d7 # As user
# reboot
$ (Various packages installed, guix shell used, etc., as user.)
# aa-complain guix-daemon ## Tested with AppArmor profile disabled.
# guix gc --collect-garbage=0
finding garbage collector roots...
cannot read potential root
'/var/guix/gcroots/auto/1nk4s2q84xwjn5rx1xbliw7b9j8g5x5k': Permission denied
cannot read potential root
'/var/guix/gcroots/auto/kjwm1jravfnv5l81v9234gyyf3il3sl1': Permission denied
cannot read potential root
'/var/guix/gcroots/auto/vp6jq9wlkjcl72n5ia4n49ddiiv0hwg0': Permission denied
cannot read potential root
'/var/guix/gcroots/auto/hlyl4syrk7jgckfr7zfs4aic4vdz42gl': Permission denied
cannot read potential root '/var/guix/profiles/per-user/user/inferiors':
Permission denied
cannot read potential root '/var/guix/profiles/per-user/user/profiles':
Permission denied
deleting `/gnu/store/trash'
deleting unused links...
note: currently hard linking saves    7.38 GiB
guix gc: freed 0 bytes
```

The first symlink resolves as follows:

/var/guix/gcroots/auto/1nk4s2q84xwjn5rx1xbliw7b9j8g5x5k
->
/var/guix/profiles/per-user/user/inferiors/hl6c4x7vpnrrwidrvyvxgxqrry24hzfzpa7sev3ym3gnz4xszsrq
-> /gnu/store/axf351rjirmgkw33plwm5fnzdjcl5xs9-profile

In addition to the problem reading the root links, `guix gc` should
probably in this case fail with an error rather than proceeding with the
gc and deleting required store items.

Thanks,
Owen

Reply via email to