Cannot start snap after updating snapd - lost race to create dir /tmp/snap

We publish a snap package version of our app, and a Raspberry Pi image that contains everything setup and ready to go, however just recently we have been receiving complaints that the software is broken after performing an apt update && apt upgrade

We have confirmed the issue internally, and we can see that performing an upgrade on the Raspberry Pi, includes an update to snapd.

Our snap package that was working previously now does not start and throws the following error

lost race to create dir /tmp/snap.1000_vuepilot_XXXXXX too many times: No such file or directory

Looking at the /tmp directory, I can see there or dozens of empty directories that read something like snap.1000_vuepilot_XXXXXX.5d957c1af7d9ac9fad86

Clearing them, they just come back when you try to start the app again.

The version of snapd is: 2.37.4-1+rpi1+deb10u1

The snap that’s broken is: vuepilot

This is impacting a bunch of my customers now, and initial attempts to solve the issue have come up with nothing useful. Does anyone have any advice on how to fix this issue?

Logs from journalctl -u snapd

journalctl -u snapd
-- Logs begin at Thu 2019-02-14 21:11:59 AEDT, end at Thu 2022-03-24 10:36:20 AEDT. --
Mar 24 09:36:04 vuepilot systemd[1]: Starting Snappy daemon...
Mar 24 09:36:04 vuepilot snapd[480]: AppArmor status: apparmor not enabled
Mar 24 09:36:05 vuepilot snapd[480]: daemon.go:379: started snapd/2.37.4-1+rpi1+deb10u1 (series 16; classic; devmode) raspbian/10 (armhf) linux/5.10.103-v7l.
Mar 24 09:36:05 vuepilot systemd[1]: Started Snappy daemon.
Mar 24 09:36:30 vuepilot snapd[480]: stateengine.go:102: state ensure error: cannot decode new commands catalog: got unexpected HTTP status code 429 via GET to "https://api.
Mar 24 09:41:38 vuepilot snapd[480]: kernel_os.go:192: cannot get boot settings: cannot determine bootloader
Mar 24 09:41:49 vuepilot snapd[480]: api.go:1077: Installing snap "vuepilot" revision unset
Mar 24 09:41:57 vuepilot snapd[480]: link.go:75: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: no such file or d
lines 1-9/9 (END)

Output from snap list

Name               Version                     Rev   Tracking  Publisher   Notes
bare               1.0                         5     stable    canonicalâś“  base
core18             20220309                    2348  stable    canonicalâś“  base
gnome-3-28-1804    3.28.0-19-g98f9e67.98f9e67  163   stable    canonicalâś“  -
gtk-common-themes  0.1-59-g7bca6ae             1519  stable    canonicalâś“  -
vuepilot           2.2.9                       70    stable    vuepilot    -

Just following this up here for anyone else who hits this problem but we were able to fix the issue by installing core. We had previously only had core18 installed

So, running

sudo snap install core

1 Like

Installing “core” or “snapd” on Debian based systems actually upgrades the version of snapd in use, you’ll notice snap version would return 2.54 (maybe 2.55) now, whereas the version in apt would still be 2.37

It’s effectively always recommended to try :slight_smile:

Hmm ok, interesting, I did not know that… I mean, it makes sense now that I think about it (upgrading core), just didn’t occur to me the core was actually a snap itself.

Thanks for the tip