Seed.yaml: need a model assertion

I’m creating a custom Ubuntu image for my office, and we’d it to include some snaps installed by default. Because the image is created in a chroot environment, we cannot use snap install to install them. I thought that using seed.yaml would work for me, but I’m running into some problems. I used snap download intellij-idea-ultimate to get the .snap and .assert files, then I put the .snap file in /var/lib/snapd/seed/, and the .assert file into /var/lib/snapd/seed/assertions. When I try seeding the machine, I get the error message:

stateengine.go:101: state ensure error: devicemgr: need a model assertion

I looked it up, and it looks like a model assertion is some extra assertion meant to provide detail about the computer where the snap was built, or the computer it’s targeting, but I don’t know how to get that for Intellij. It is a classic snap, I’m not sure if that matters.

What can I do here?

Yes, we don’t support seeding without an explicit model assertion in /var/lib/snapd/seed/assertions (together with the matching key and account assertion).

I imagine this would be a classic image (not a core image?), there are two options:

  • reuse explicitly the fallback generic/generic-classic assertion by copying it there,
    snap known model on a normal classic system with a recent snapd will print it
  • create a model assertion like for a core system but instead of specifying kernel, gadget, and architecture, add "classic": "true" to the input JSON. One needs then to copy also the developer account and account-key for the used signing key together with the model assertion, to get those:
    • snap known --remote account account-id=DEVELOPER-ID where DEVELOPER-ID can be found with a logged in snapcraft whoami
    • snap known --remote account-key public-key-sha3-384=SHA3-384-FINGERPRINT where SHA3-384-FINGERPRINT is what is printed by snapcraft list-keys