system fails to boot after refreshing core20 & a bad kernel at the same time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OEM Priority Project |
Fix Committed
|
Critical
|
Unassigned | ||
snapd |
Fix Released
|
Undecided
|
Alfonso Sanchez-Beato |
Bug Description
[Summary]
When a UC20 system refreshes kernel and core20 snaps at the same time, if the kernel is bad, the system will not boot (this is expected).
After restarting the system, it will use the previous kernel snap. Then the system will not only revert the kernel snap, but also the core20 snap.
It will reboot automatically then fail to boot. (see the attached screenshot.
[Step to reproduce]
1. use https:/
2. follow https:/
$ qemu-system-x86_64 -smp 2 -m 2048 -net nic,model=virtio -net user,hostfwd=
3. login the system and make sure all snaps are up to date before testing.
$ sudo snap refresh
4. run these commands:
# to have a new kernel snap
$ snap switch pc-kernel --channel 22/stable
"pc-kernel" switched to the "22/stable" channel
# to have a new core20 snap
# depends on the release, the channel could be stable or edge
$ snap switch core20 --stable
"core20" switched to the "latest/edge" channel
$ snap refresh --list
Name Version Rev Size Publisher Notes
core20 20220614 1550 64MB canonical✓ base
pc-kernel 5.15.0-35.36.1 1021 289MB canonical✓ kernel
$ snap refresh
snapd is about to reboot the system
# postponse the shutdown
$ sudo shutdown -c
# make a bad kernel
$ sudo sh -c "cat /dev/null > /run/mnt/
$ sudo reboot
4. after reboot, GRUB will fail to boot. Close the qemu window and restart it
5. The system will continue the boot process, reboot again and later show:
error: base snap "core20_[rev].snap" does not exist on ubuntu-data
example input and output: https:/
[Expected result]
The system should boot correctly with the previous kernel. (I wonder if it make sense to revert core20 as well)
[Actual result]
The system fails to boot and there is no way to recover.
[Fail rate]
100%
[Additional information]
I also observed this issue on different platform.
tags: | added: oem-priority |
description: | updated |
description: | updated |
Changed in snapd: | |
assignee: | nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato) |
status: | Incomplete → In Progress |
Changed in snapd: | |
status: | In Progress → Fix Committed |
Changed in oem-priority: | |
importance: | Undecided → Critical |
status: | New → Fix Committed |
Changed in snapd: | |
status: | Fix Committed → Fix Released |
in ubuntu- date:system- data/var/ lib/snapd/ snaps/ of the disk image, there's no core20_1550.snap.
$ tree img/system- data/var/ lib/snapd/ snaps/ data/var/ lib/snapd/ snaps/
img/system-
├── core20_1518.snap
├── pc_115.snap
├── pc-kernel_1032.snap
└── snapd_16010.snap