Debugging snapd failures in a new image

Hi,

We are developing an image based on uc20. Whenever we hit a problem that effects initial install / seeding we find it very hard to debug and find the cause, because in our experience there is very little in helpful output on the screen.

We have recently hit another problem such as this, where snapd is failing to seed for some reason, and we don’t know why.

Is there any way we can make the seeding, snapd, or boot generally, more verbose on the tty temporarily ? Even if it means setting some config in the image ?

The specific problem currently is like this:
After initial disk setup and install, it reboots, start initialising snaps, then gets stuck for a long time:

[   OK   ] Stopped Wait until snapd is fully seeded.
           Stopping Snap Daemon...

After a while is eventually gets to

[   OK   ] Stopped Snap Daemon.

then a few more OK lines and it hits:

[ FAILED ] Failed to start Failure handling of the snapd snap.

How can we debug this ?

Thanks.

Cheers,
Just

Adding snapd.debug=1 and systemd.journald.forward_to_console=1 to the kernel command line will add more verbose output from snapd about what might be going on.

@ijohnson Do you mean as part of the chainloader command in grub ?

I’ve tire adding it there in an instance running in QEMU, and it doesn’t seem to make any difference. Nothing extra on main tty or serial console.

You will need to add it to the kernel command line with the linux command in the second grub, i.e. the grub on ubuntu-boot. The one on ubuntu-seed won’t help you unless you are booting into recover mode

Thanks @ijohnson , that worked :slight_smile:

Cheers, Just

1 Like