Refreshing a snap using core18 to one using core16 confuses the snap apps
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
High
|
Zygmunt Krynicki |
Bug Description
Refreshing a snap using core18 to one using core16 makes the apps in the snap fail due to problems loading libraries. For instance, installing network-manager snap from the 1.10 track, that has core18 as base:
$ snap install --channel=1.10 network-manager
$ nmcli
...
If we refresh to the default track, that has core16 as base:
$ snap refresh --stable network-manager
$ nmcli
/snap/network-
$ snap run --shell network-
<user@dev>
/snap/core/
<user@dev>
ls: cannot access '/lib/arm-
It looks like /lib/arm-
This has been detected on a UC16 system.
description: | updated |
Changed in snapd: | |
assignee: | nobody → Samuele Pedroni (pedronis) |
importance: | Undecided → High |
status: | New → Triaged |
Changed in snapd: | |
assignee: | Samuele Pedroni (pedronis) → Zygmunt Krynicki (zyga) |
Changed in snapd: | |
status: | In Progress → Fix Committed |
milestone: | 2.44 → 2.43.3 |
I've reproduced this issue.
It seems that there's something wrong with the base transition detector. Some correlated output:
Loopback devices:
/dev/loop0 0 0 0 1 /writable/ system- data/var/ lib/snapd/ snaps/core_ 8594.snap snapd/snaps/ core_8594. snap snapd/snaps/ core18_ 1671.snap
/dev/loop5 0 0 1 1 /var/lib/
/dev/loop20 0 0 1 1 /var/lib/
Preserved (stale) mount namespace:
1974 1643 7:20 / / ro,nodev,relatime master:284 - squashfs /dev/loop20 ro
2067 2064 7:5 / /snap/core/8594 ro,nodev,relatime master:230 - squashfs /dev/loop5 ro
Diagnostic message during detection:
DEBUG: block device of snap core, revision 8594 is 7:5
DEBUG: preserved mount is not stale, reusing
So snap-confine was correctly looking for presence of 7:5 (corresponding to core) but failed to observe that in the mount namespace the root filesystem is 7:20 (corresponding to core18).
There is an integration test for this feature so it must be something more subtle.