Ubuntu core 20 hangs with added snap?

Hello,
I have a odd behaviour using a snap in a ubuntu core image… I can show you what happens using this barebone snap (I started from a more complex snap but it behaves in the same way):

name: pleasedonthang
base: core20
version: '0.1'
summary: shows a possible bug
description: this snap does nothing, but...
type: app
confinement: devmode
grade: devel

parts:
  scripts:
    plugin: nil

This snap compiles using “snapcraft” with no errors or warning, it gets installed fine in a ubuntu core 20, and as expected it does nothing at all.

Second step, I create a ubuntu core image with this standard model:

{
  "type": "model",
  "authority-id": "my id",
  "brand-id": "my id",
  "series": "16",
  "model": "testmodel-amd64",
  "architecture": "amd64",
  "grade": "dangerous",
  "snaps":
    [
      {
        "default-channel": "20/beta",
        "id": "UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH",
        "name": "pc",
        "type": "gadget"
      },
      {
        "default-channel": "20/beta",
        "id": "pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza",
        "name": "pc-kernel",
        "type": "kernel"
      },
      {
        "default-channel": "latest/beta",
        "id": "DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q",
        "name": "core20",
        "type": "base"
      },
      {
        "default-channel": "latest/beta",
        "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4",
        "name": "snapd",
        "type": "snapd"
      }
    ],
  "base": "core20",
  "timestamp": "2020-09-25T10:13:50+00:00"
}

everything works as expected.

But, if I add the snap to the image like this:

{
  "type": "model",
  "authority-id": "my id",
  "brand-id": "my id",
  "series": "16",
  "model": "testmodel-amd64",
  "architecture": "amd64",
  "grade": "dangerous",
  "snaps":
    [
      {
        "default-channel": "20/beta",
        "id": "UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH",
        "name": "pc",
        "type": "gadget"
      },
      {
        "default-channel": "20/beta",
        "id": "pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza",
        "name": "pc-kernel",
        "type": "kernel"
      },
      {
        "default-channel": "latest/beta",
        "id": "DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q",
        "name": "core20",
        "type": "base"
      },
      {
        "default-channel": "latest/beta",
        "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4",
        "name": "snapd",
        "type": "snapd"
      },
      {
        "name": "pleasedonthang",
        "type": "app"
      }
    ],
  "base": "core20",
  "timestamp": "2020-09-25T10:13:50+00:00"
}

… the system installs, but then it completely hangs with no information, only a cursor blinking.

My questions are:

  • how can I debug a similar issue? There is no errors, no warnings, no login prompt, no network, no information on the console, only a blinking cursor; debugging looks very challenging
  • why does it hang? :slight_smile:

Thank you,
Sandro

1 Like

have you tried changing this to strict and retrying ?

Also when you build the image, I assume you use ubuntu-image, can you show us what revisions of snaps your image ends up using from the seed.manifest file that ubuntu-image generates?

Hi Ian,
yes, with “confinement: strict” it does not lock up… can I ask why is this happening?

If this is something expected, it would be very useful to add a visible error for other people doing the same mistake… :slight_smile:

The seed.manifest is:

snapd 9607
pc-kernel 612
core20 849
pc 108

Thank you,
Sandro

I think this is a bug on our side, I will look into this for you and report back soon

Well this is a fun bug you have found, I can reproduce it here without putting the snap in the model assertion, so just the mere presence of a devmode snap breaks run mode snap seeding.

It’s still unclear why there is nothing printed on the console, normally you should see some sort of error after trying to use console-conf, but in this case something is stuck waiting somewhere.

Hi, yes this is a bug, see https://bugs.launchpad.net/snapd/+bug/1898622 for more details and progress fixing it. Unfortunately we have no workaround except to not make the snap devmode right now.

Hi, thank you for opening the bug report.

I can see an error from snapd log, is it possibile to see those logs when the system is in this situation for debugging?