[Bug 2057888] Re: Private store may not contain lxd snap

Paul Mars 2057888 at bugs.launchpad.net
Thu Apr 11 08:22:33 UTC 2024


You are currently building the image based on a existing tarball (see
https://pastebin.ubuntu.com/p/mM8Dh7tSXh/). The
`/var/lib/snapd/state.json` file (see
https://pastebin.ubuntu.com/p/jcQcC73wrd/plain/) contains lxd in it.

> By deafult, there is lxd and core20 snap in that
file(var/lib/snapd/state.json)

What do you mean? Is that because lxd is in `/var/lib/snapd/state.json`?

I suppose you could maybe remove lxd from the state.json before building
the image. I understand in the hook you mention the solution was to
completely nuke snapd, remove the state.json file and reinstall snapd.
It feels a bit extreme and I suspect we might lose some information.

I will need to think more about it to define what would make sense in
ubuntu-image. I am not sure a flag to skip/remove the existing
`/var/lib/snapd/state.json` would be the best idea. If we take a step
back I think here we are trying to deal with an "imperfect" pre-existing
tarball rootfs. I need to determine what we want to support in ubuntu-
image and even if this is the responsibility of ubuntu-image to fix
this.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to Ubuntu Image.
https://bugs.launchpad.net/bugs/2057888

Title:
  Private store may not contain lxd snap

Status in Ubuntu Image:
  Incomplete

Bug description:
  Hi,

  I defined core22 and snapd in extra-snaps, but the ubuntu-image 3.x
  will also try to download lxd snap after downloaded core22 and snapd,
  and lxd is actually not included in the private store

  If I understand correctly, in internal/statemachine/classic_states.go,
  the function prepareClassicImage will try to check the file called
  var/lib/snapd/state.json, and tries to preseed the snaps defined in
  that file afterwards. However, lxd snap may not be included in private
  store, then it will fail to preseed the snap.

  Previously in ubuntu-image 2.x, we leveraged the
  commit(https://git.launchpad.net/livecd-rootfs/commit/live-
  build/functions?id=b43e3b84f4c9100379f4686f80699929c7657056) from
  foundation team, I don't know if this mechanism should be integrated
  into ubuntu-image 3.x as well? Or maybe we can have a flag to skip
  checking var/lib/snapd/state.json?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-image/+bug/2057888/+subscriptions




More information about the foundations-bugs mailing list