snap revert doesn't do anything with snaps that use assumes

Bug #1856058 reported by Ian Johnson on 2019-12-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When installing a snap, we check that the current version of snapd is sufficient to satisfy the assumes in the snap.yaml, but nothing is done when we revert snapd to an earlier version.

For example with `assumes: [snapd2.41]` and a snap that uses `snapctl set-health`, if I install the snap under snapd 2.42.4, the snap works correctly. Then if I revert snapd to 2.39.4, the snap is left as is, even though it is effectively broken. See:

ubuntu@meet-drake:~$ snap version
snap 2.42.4
snapd 2.42.4
series 16
kernel 4.15.0-72-generic
ubuntu@meet-drake:~$ sudo snap install --dangerous my-snap-name_0.1_amd64.snap
my-snap-name 0.1 installed
ubuntu@meet-drake:~$ my-snap-name
ubuntu@meet-drake:~$ echo $?
ubuntu@meet-drake:~$ sudo snap revert snapd
2019-12-11T15:16:22Z INFO Waiting for restart...
snapd reverted to 2.39.2
ubuntu@meet-drake:~$ snap list my-snap-name --all
Name Version Rev Tracking Publisher Notes
my-snap-name 0.1 x1 - - -
ubuntu@meet-drake:~$ my-snap-name
error: error running snapctl: Unknown command `set-health'. Please specify one command of: get, restart, services, set, start or stop
ubuntu@meet-drake:~$ snap version
snap 2.39.2
snapd 2.39.2
series 16
kernel 4.15.0-72-generic

I would have expected either snaps with assumes higher than the current revision to be marked as broken at least or possibly fully disabled when we go to revert snapd. This is a harmless example, but if we had something like network-manager depend on a snapd version and it failed then reverting snapd would break that snap and thus break the system.

Changed in snapd:
importance: Undecided → High
status: New → Triaged
Changed in snapd:
importance: High → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers