Sanoid has been working fine for the most part, but suddenly I noticed that silently there haven’t been zfs snapshots made automatically for some days now.
2026-04-03T19:32:21+02:00 systemd[1]: Started Sanoid snapshot service.
2026-04-03T19:32:21+02:00 sanoid[697691]: ignored key 'recursive' from user-defined default template.
2026-04-03T19:32:21+02:00 sanoid[697691]: ignored key 'recursive' from 'default' template.
2026-04-03T19:32:22+02:00 sanoid[697712]: cannot create snapshots : permission denied
2026-04-03T19:32:22+02:00 sanoid[697691]: CRITICAL ERROR: zfs snapshot failed, 256 at /nix/store/y7i6annfadz6sz9rn4slc51kx2crv7v1-sanoid-2.3.0/bin/.sanoid-wrapped line 705.
2026-04-03T19:32:22+02:00 sanoid[697714]: cannot create snapshots : permission denied
2026-04-03T19:32:22+02:00 sanoid[697691]: CRITICAL ERROR: zfs snapshot failed, 256 at /nix/store/y7i6annfadz6sz9rn4slc51kx2crv7v1-sanoid-2.3.0/bin/.sanoid-wrapped line 705.
2026-04-03T19:32:22+02:00 sanoid[697717]: cannot destroy snapshots: permission denied
2026-04-03T19:32:22+02:00 sanoid[697691]: could not remove : 256 at /nix/store/y7i6annfadz6sz9rn4slc51kx2crv7v1-sanoid-2.3.0/bin/.sanoid-wrapped line 413.
2026-04-03T19:32:22+02:00 zfs[697719]: Usage: unallow [-rldug] <"everyone"|user|group>[,...]
...
2026-04-03T19:32:22+02:00 zfs[697719]: zfs: error: invalid user/group sanoid
In the nixos module, the service config sets DynamicUser = true, so I would expect this to work.
The relevant part from the generated service’s Service section:
DynamicUser=true
ExecStart=/nix/store/y7i6annfadz6sz9rn4slc51kx2crv7v1-sanoid-2.3.0/bin/sanoid --cron --configdir /nix/store/24dcynd6kng2vamb9j1yrvvpvpz281s9-sanoid.conf
ExecStartPre=-+/run/booted-system/sw/bin/zfs allow sanoid snapshot,mount,destroy zroot/keep
ExecStopPost=-+/run/booted-system/sw/bin/zfs unallow sanoid snapshot,mount,destroy zroot/keep
Group=sanoid
RuntimeDirectory=sanoid
User=sanoid
So it seems the ExecStartPre’s execution of zfs can’t resolve the user/group sanoid.
I found something similar in nixos/glance: glance-start-pre: install: invalid user 'glance' · Issue #409348 · NixOS/nixpkgs · GitHub, but restarting the service does not work for me.
Also Seeking advice on how to fix ddclient service dependencies
Does anybody else have this issue?