Error Starting snapd: system-key missing on disk

When installing snapd on my RHEL 8 VM using: dnf install snapd, i’m able to successfully install but not start the service.

Version info: snap version snap 2.65.1-0.el8 snapd 2.65.1-0.el8 series 16

I’ve followed this guide here: Install microk8s on Red Hat Enterprise Linux using the Snap Store | Snapcraft

But when running: systemctl start snapd I get the following error logs below (from journalctl -u snapd):

Oct 14 04:11:14 vlstoremonitrngpr01 systemd[1]: /usr/lib/systemd/system/snapd.service:23: Unknown lvalue ‘RestartMode’ in section ‘Service’ Oct 14 04:12:07 vlstoremonitrngpr01 systemd[1]: Starting Snap Daemon… Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: overlord.go:271: Acquiring state lock file Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: overlord.go:276: Acquired state lock file Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: daemon.go:250: started snapd/2.65.1-0.el8 (series 16; classic; devmode) rhel/8.4 (amd64) linux/4.18.0-305.25.1.el8_4.x86. Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: daemon.go:353: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap) Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: backends.go:58: AppArmor status: apparmor not enabled Oct 14 04:12:07 vlstoremonitrngpr01 snapd[10722]: helpers.go:160: error trying to compare the snap system key: system-key missing on disk Oct 14 04:12:07 vlstoremonitrngpr01 systemd[1]: Started Snap Daemon. Oct 14 04:12:12 vlstoremonitrngpr01 snapd[10722]: daemon.go:548: gracefully waiting for running hooks Oct 14 04:12:12 vlstoremonitrngpr01 snapd[10722]: daemon.go:550: done waiting for running hooks Oct 14 04:12:15 vlstoremonitrngpr01 snapd[10722]: overlord.go:515: Released state lock file Oct 14 04:12:15 vlstoremonitrngpr01 snapd[10722]: daemon stop requested to wait for socket activation Oct 14 04:12:15 vlstoremonitrngpr01 systemd[1]: snapd.service: Succeeded.


I’ve already ran: setenforce 0 (and it still doesn’t work) and the system-key file exists at /var/lib/snapd/system-key and looks correct.

Any help would be really appreciated!

The log indicates that the service was started. Have you tried running any snap commands?

Hi @mborzecki1,

The systemctl status snapd output shows that the snapd exited with status code 42.

Still not sure why it’s exited after the message “snapd.service: Succeeded”.

But after installing a snap: snap install microsk8s --classic, it is now showing as running successfully. So I think its resolved.

Thanks for the quick response!

This is expected. When no snaps installed there’s no point in snapd in having run and use system resources so it will simply shut down. Status 42 is expected by systemd, as listed in snapd.service:

SuccessExitStatus=42
RestartPreventExitStatus=42
1 Like

Thanks @mborzecki1, appreciate the explanation. This makes sense