snap breaks after every boot

I have the snapd package, which provides the command line client for Canonical’s Snap Store, installed from the https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.3 repo.

When setting it up initially everything worked great, but after a reboot all the installed snaps are in the ‘broken’ state when using the snap list command. The snap files themselves are all still there at /var/lib/snapd/snaps/:


 # ls -hl   /var/lib/snapd/snaps/*
-rw------- 2 root root  56M Jun  9 15:20 /var/lib/snapd/snaps/core18_2066.snap
-rw------- 2 root root 100M Jun 17 14:39 /var/lib/snapd/snaps/core_11187.snap
-rw------- 2 root root  78M Jun 13 16:01 /var/lib/snapd/snaps/discord_128.snap
-rw------- 2 root root 163M Jun  9 15:21 /var/lib/snapd/snaps/gnome-3-28-1804_145.snap
-rw------- 2 root root  66M Jun 13 16:00 /var/lib/snapd/snaps/gtk-common-themes_1515.snap
-rw------- 2 root root 100M Jun  8 10:10 /var/lib/snapd/snaps/kotlin_59.snap
-rw------- 2 root root 167M Jun  9 15:20 /var/lib/snapd/snaps/signal-desktop_358.snap
-rw------- 2 root root  33M Jun  9 15:29 /var/lib/snapd/snaps/snapd_12057.snap
-rw------- 1 root root  33M Jun 15 15:34 /var/lib/snapd/snaps/snapd_12159.snap

but they aren’t being mounted under /snap, until I remove and reinstall them using the snap client. Then they’ll work again until reboot.

So basically the problem is that the squashfs files aren’t remounted at boot. systemctl status snapd has a lot of errors related to the files being missing, but not why the snaps aren’t being remounted:

Jun 17 14:47:46 shiso.localdomain snapd[422]: helpers.go:96: cannot add snap "signal-desktop" to interface repository: snap is broken: cannot find installed snap "signal-desktop" at revision 358: missing file /snap/signal-desktop/358/meta/snap.yaml
Jun 17 14:47:46 shiso.localdomain snapd[422]: helpers.go:96: cannot add snap "snapd" to interface repository: snap is broken: cannot find installed snap "snapd" at revision 12159: missing file /snap/snapd/12159/meta/snap.yaml
Jun 17 14:47:46 shiso.localdomain snapd[422]: helpers.go:96: cannot add snap "core18" to interface repository: snap is broken: cannot find installed snap "core18" at revision 2066: missing file /snap/core18/2066/meta/snap.yaml
Jun 17 14:47:46 shiso.localdomain systemd[1]: Started Snap Daemon.

It’s like it’s not even trying to remount them.

My root (including /tmp and /var) is btrfs, home is XFS, /run is tmpfs

Thanks,
Ian

It looks to me like the systemctl status snapd errors can explain why snapd is not working.

Is there a /snap/snapd/ directory? If so please share the output of “find /snap/snapd/”
Also, what is “sudo journalctl -b -u snapd” returning?

Don’t get this. Either there /snap/snapd exists (an abolute path, thus directly from the root /) or it doesn’t . When you know (after answering the first question), why try to find it? And when it exists and you apply that find statement it will output the same as an

ls /snap/snapd/

, but without sorting.

/snap exists, has a tree of the different installed snaps, a bunch of directories that could be mountpoints, the issue is that none of them are remounted. These mounts are supposed to come up automatically on boot (you can find Ubuntu users on the Internet complaining about this huge list of mounts ha) but they don’t.

I’ve now “resolved” the problem for myself by using flatpak instead. I’m still interested in a real solution though if anyone knows it. Does this snapd on opensuse actually work correctly for anyone? My guess is that it’s broken for everyone (without manually mounting) or there’s some obscure systemd setting I’ve flipped on my computer that inhibits all the snaps from remounting automatically.

here’s the sudo journalctl -b -u snapd output, I bet the issue is related to these udev event errors

-- Logs begin at Wed 2021-06-16 08:25:53 PDT, end at Fri 2021-06-18 13:51:09 PDT. --
Jun 16 08:54:57 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:57 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:57 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:57 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:57 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:58 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:58 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:58 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:58 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 08:54:58 shiso.localdomain snapd[2000]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
Jun 16 15:38:16 shiso.localdomain snapd[2000]: snapmgr.go:296: cannot read snap info of snap "gtk-common-themes" at revision 1515: cannot find installed snap "gtk-common-themes" at revision 1515: missing file /snap/gtk-common-themes/1515/meta/snap.yaml
Jun 16 15:38:16 shiso.localdomain snapd[2000]: snapmgr.go:296: cannot read snap info of snap "kotlin" at revision 59: cannot find installed snap "kotlin" at revision 59: missing file /snap/kotlin/59/meta/snap.yaml
Jun 16 15:38:16 shiso.localdomain snapd[2000]: snapmgr.go:296: cannot read snap info of snap "signal-desktop" at revision 358: cannot find installed snap "signal-desktop" at revision 358: missing file /snap/signal-desktop/358/meta/snap.yaml
[etc etc]

Does this file exist? If yes, does it work if you disable apparmor (aa-teardown)?

no the file doesn’t exist, /snap/gtk-common-themes/1515/ is the mount point that isn’t being mounted