Comment 0 for bug 1978785

Revision history for this message
Robert Liu (robertliu) wrote :

[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://cdimage.ubuntu.com/ubuntu-core/20/dangerous-beta/20220614.1/ as the testing image
2. follow https://ubuntu.com/download/kvm to boot the system and finish first-boot process
3. login the system and 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
$ snap switch core20 --edge
"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
# make a bad kernel
$ cd /run/mnt/ubuntu-boot/EFI/ubuntu/pc-kernel_1021.snap/
$ sudo sh -c 'cat /dev/null > kernel.efi'
$ 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 and later show:
  error: base snap "core20_1550.snap" does not exist on ubuntu-data

[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.