Including extra base snaps in a model assertion

Hi,

With UC20, you can declare snaps in a model assertion using the following snaps syntax:

  "base": "core20",
  "snaps":
    [
      {
        "name": "test-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"
      },

…and everything works fine. I can create the model assertion and then the image.

In the smae document, if I then declare another snap that uses base core18, when I try to build it ubuntu-image complains that the base core18 is not included in the model assertion. If I then add core18 as another entry in the snaps list, like this:

      {
        "default-channel": "latest/stable",
        "id": "CSO04Jhav2yK0uz97cr0ipQRyqg0qQL6",
        "name": "core18",
        "type": "base"
      },

…it will build ok, but on first boot the installation process fails with an error:

the-tool[258]: error: cannot load metadata and verify essential bootstrap snaps [base kernel snapd]: model does not specify all the requested essential snaps: [base kernel snapd]

So, even though the model assertion document already has a dedicated base variable that specifies core20 is the base, the additional base snap in the image seems to confuse things and breaks the install/setup process.

The only way I can successfully create an image and a working installation without error, is to specify both the app snap and the extra base snap using the --snap argument for each snap when calling the ubuntu-image utility.

It seems strange that in this situation I can’t include all the snap components of the image in the model assertion directly - that should be the document the fully describes the image.

Am I missing something here ?
What is the recommended way of working with this scenario ?
Have I simply found a bug ? [ will happily raise one if so ]

Cheers,
Just

This is bug https://bugs.launchpad.net/snapd/+bug/1883973, it will be fixed in the next pc-kernel snap release to edge, which is supposed to be released tomorrow AIUI

1 Like

Ah - awesome. I have to confess I did not do much googling on this one [ it was the end of a busy day ], otherwise I would probably have found the bug :slight_smile:

Thanks for the info @ijohnson

Cheers,
Just

For what it is worth, the pc-kernel snap now published to 20/candidate (rev 612) seems to produce a working image for models containing multiple base snaps.

1 Like