snap-<snapname>-<revision>.mount systemd units left behind

Bug #1950864 reported by James Blachly
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

`snap` evidently automatically updates snaps, but in the process of doing so, leaves old `snap-<snapname>-<revision>.mount` systemd units left behind in memory. Because the unit definitions are no longer on disk in /etc/systemd/, this leads `systemctl` to report that the system is degraded.

Contents of `/etc/systemd/system`:

```
-rw-r--r-- 1 root root 285 Oct 18 02:01 snap-core18-2128.mount
-rw-r--r-- 1 root root 285 Oct 26 08:46 snap-core18-2246.mount
-rw-r--r-- 1 root root 285 Oct 13 13:49 snap-core20-1169.mount
-rw-r--r-- 1 root root 279 Oct 26 22:47 snap-lxd-21780.mount
-rw-r--r-- 1 root root 279 Nov 10 09:57 snap-lxd-21858.mount
-rw-r--r-- 1 root root 285 Oct 20 06:10 snap-snapd-13640.mount
-rw-r--r-- 1 root root 285 Nov 9 23:47 snap-snapd-13831.mount
-rw-r--r-- 1 root root 288 Oct 18 02:02 snap-wormhole-349.mount
```

`$ systemctl status` shows 3 units failed (2 are lxd and 1 is snapd):

```
● ubuntu
    State: degraded
     Jobs: 0 queued
   Failed: 3 units
    Since: Tue 2021-10-26 16:31:38 UTC; 2 weeks 3 days ago
...
```

 `$ systemctl -a snap-snapd*` yields 1 failure:

```
● snap-snapd-13640.mount - Mount unit for snapd, revision 13640
     Loaded: loaded (/proc/self/mountinfo; enabled; vendor preset: enabled)
     Active: active (mounted) since Tue 2021-10-26 16:31:46 UTC; 2 weeks 3 days ago
      Where: /snap/snapd/13640
       What: /dev/loop4
      Tasks: 0 (limit: 231992)
     Memory: 144.0K
        CPU: 8ms
     CGroup: /system.slice/snap-snapd-13640.mount

Oct 26 16:31:45 ubuntu systemd[1]: Mounting Mount unit for snapd, revision 13640...
Oct 26 16:31:46 ubuntu systemd[1]: Mounted Mount unit for snapd, revision 13640.

× snap-snapd-13270.mount
     Loaded: not-found (Reason: Unit snap-snapd-13270.mount not found.)
     Active: failed (Result: exit-code) since Tue 2021-11-09 23:47:38 UTC; 3 days ago
        CPU: 7ms

Oct 26 16:31:45 ubuntu systemd[1]: Mounting Mount unit for snapd, revision 13270...
Oct 26 16:31:46 ubuntu systemd[1]: Mounted Mount unit for snapd, revision 13270.
Nov 09 23:47:38 ubuntu systemd[1]: Unmounting Mount unit for snapd, revision 13270...
Nov 09 23:47:38 ubuntu umount[2461004]: umount: /snap/snapd/13270: not mounted.
Nov 09 23:47:38 ubuntu systemd[1]: snap-snapd-13270.mount: Mount process exited, code=exited, status=32/n/a
Nov 09 23:47:38 ubuntu systemd[1]: snap-snapd-13270.mount: Failed with result 'exit-code'.
Nov 09 23:47:38 ubuntu systemd[1]: Unmounted Mount unit for snapd, revision 13270.

● snap-snapd-13831.mount - Mount unit for snapd, revision 13831
     Loaded: loaded (/proc/self/mountinfo; enabled; vendor preset: enabled)
     Active: active (mounted) since Tue 2021-11-09 23:47:31 UTC; 3 days ago
      Where: /snap/snapd/13831
       What: /dev/loop7
      Tasks: 0 (limit: 231992)
     Memory: 4.0K
        CPU: 6ms
     CGroup: /system.slice/snap-snapd-13831.mount

Nov 09 23:47:31 ubuntu systemd[1]: Mounting Mount unit for snapd, revision 13831...
Nov 09 23:47:31 ubuntu systemd[1]: Mounted Mount unit for snapd, revision 13831.
```

and `$ systemctl -a snap-lxd*` yields 2 failures:

```
× snap-lxd-21750.mount
     Loaded: not-found (Reason: Unit snap-lxd-21750.mount not found.)
     Active: failed (Result: exit-code) since Wed 2021-11-10 09:58:22 UTC; 3 days ago
        CPU: 8ms

Oct 26 16:31:45 ubuntu systemd[1]: Mounting Mount unit for lxd, revision 21750...
Oct 26 16:31:45 ubuntu systemd[1]: Mounted Mount unit for lxd, revision 21750.
Nov 10 09:58:22 ubuntu systemd[1]: Unmounting Mount unit for lxd, revision 21750...
Nov 10 09:58:22 ubuntu umount[3303696]: umount: /snap/lxd/21750: not mounted.
Nov 10 09:58:22 ubuntu systemd[1]: snap-lxd-21750.mount: Mount process exited, code=exited, status=32/n/a
Nov 10 09:58:22 ubuntu systemd[1]: snap-lxd-21750.mount: Failed with result 'exit-code'.
Nov 10 09:58:22 ubuntu systemd[1]: Unmounted Mount unit for lxd, revision 21750.

● snap-lxd-21858.mount - Mount unit for lxd, revision 21858
     Loaded: loaded (/proc/self/mountinfo; enabled; vendor preset: enabled)
     Active: active (mounted) since Wed 2021-11-10 09:58:00 UTC; 3 days ago
      Where: /snap/lxd/21858
       What: /dev/loop3
      Tasks: 0 (limit: 231992)
     Memory: 4.0K
        CPU: 6ms
     CGroup: /system.slice/snap-lxd-21858.mount

Nov 10 09:58:00 ubuntu systemd[1]: Mounting Mount unit for lxd, revision 21858...
Nov 10 09:58:00 ubuntu systemd[1]: Mounted Mount unit for lxd, revision 21858.

● snap-lxd-21780.mount - Mount unit for lxd, revision 21780
     Loaded: loaded (/proc/self/mountinfo; enabled; vendor preset: enabled)
     Active: active (mounted) since Tue 2021-10-26 22:47:29 UTC; 2 weeks 3 days ago
      Where: /snap/lxd/21780
       What: /dev/loop8
      Tasks: 0 (limit: 231992)
     Memory: 4.0K
        CPU: 5ms
     CGroup: /system.slice/snap-lxd-21780.mount

Oct 26 22:47:29 ubuntu systemd[1]: Mounting Mount unit for lxd, revision 21780...
Oct 26 22:47:29 ubuntu systemd[1]: Mounted Mount unit for lxd, revision 21780.

× snap-lxd-21723.mount
     Loaded: not-found (Reason: Unit snap-lxd-21723.mount not found.)
     Active: failed (Result: exit-code) since Tue 2021-10-26 22:47:47 UTC; 2 weeks 3 days ago
        CPU: 8ms

Oct 26 16:31:45 ubuntu systemd[1]: Mounting Mount unit for lxd, revision 21723...
Oct 26 16:31:46 ubuntu systemd[1]: Mounted Mount unit for lxd, revision 21723.
Oct 26 22:47:47 ubuntu systemd[1]: Unmounting Mount unit for lxd, revision 21723...
Oct 26 22:47:47 ubuntu umount[117003]: umount: /snap/lxd/21723: not mounted.
Oct 26 22:47:47 ubuntu systemd[1]: snap-lxd-21723.mount: Mount process exited, code=exited, status=32/n/a
Oct 26 22:47:47 ubuntu systemd[1]: snap-lxd-21723.mount: Failed with result 'exit-code'.
Oct 26 22:47:47 ubuntu systemd[1]: Unmounted Mount unit for lxd, revision 21723.
```

Tags: snap
description: updated
summary: - snap-lxd-<revision>.mount systemd units left behind
+ snap-<snapname>-<revision>.mount systemd units left behind
Paul White (paulw2u)
affects: snap (Ubuntu) → snapd (Ubuntu)
Revision history for this message
Brett Holman (holmanb) wrote :

I just noticed this as well. I'm glad to see it's already reported.

Impish; latest updates. I haven't done anything with snap besides install lxd, so presumably this is default behavior.

arc~ systemctl --state=failed
  UNIT LOAD ACTIVE SUB DESCRIPTION
● snap-core-11993.mount not-found failed failed snap-core-11993.mount
● snap-core-12603.mount not-found failed failed snap-core-12603.mount
● snap-firefox-912.mount not-found failed failed snap-firefox-912.mount
● snap-firefox-941.mount not-found failed failed snap-firefox-941.mount
● snap-lxd-22358.mount not-found failed failed snap-lxd-22358.mount
● snap-lxd-22402.mount not-found failed failed snap-lxd-22402.mount
● snap-lxd-22407.mount not-found failed failed snap-lxd-22407.mount
● snap-snapd-14295.mount not-found failed failed snap-snapd-14295.mount
● snap-snapd-14549.mount not-found failed failed snap-snapd-14549.mount

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
9 loaded units listed.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.