snap prepare-image gets confused when the default track is not "latest"

Bug #1872486 reported by Alfonso Sanchez-Beato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
High
Samuele Pedroni

Bug Description

I have a model assertion (https://paste.ubuntu.com/p/vsNjth2WwF/) for UC18 that includes modem-manager as a required snap:

type: model
authority-id: VvBqrmj0g4M1DDyvelq2ktWQbP6SXXKT
series: 16
brand-id: VvBqrmj0g4M1DDyvelq2ktWQbP6SXXKT
model: pc
architecture: amd64
base: core18
gadget: pc=18
kernel: pc-kernel=18
required-snaps:
  - modem-manager
...

An important detail is that modem-manager has the 1.10 track as the default track now. When I run "snap prepare-image <this_assertion> <dir>", it downloads the snap in the 1.10 (default) track, as I see "./image/var/lib/snapd/seed/snaps/modem-manager_414.snap" (revision 414 is in 1.10/stable at the moment) in the seed. But, in seed.yaml the channel is set to "stable", which is actually "latest/stable", not "1.10/stable":

- name: modem-manager
  snap-id: KtwxgRlwCAVKFw92BUdt1WloH1Va3QPo
  channel: stable
  contact: mailto:<email address hidden>
  file: modem-manager_414.snap

So, when I start an image that uses this seed, the modem-manager that has been installed is from the 1.10 track, but it is tracking "latest/stable", so when a refresh happens it installs the snap in latest.

To be coherent, the tracked channel should be 1.10/stable, or use latest/stable when downloading the snap too.

In any case, required-snaps should allow setting the track as it happens for the gadget and kernel snaps, to remove the ambiguities here. It should be possible to control the tracked channel from the model.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

I confirmed this is happening with snapd edge version 2.44.3+git1161.g0ed5ef1

Changed in snapd:
status: New → Triaged
importance: Undecided → Critical
importance: Critical → High
Changed in snapd:
assignee: nobody → Samuele Pedroni (pedronis)
Revision history for this message
Samuele Pedroni (pedronis) wrote :

Proposed https://github.com/snapcore/snapd/pull/8523 for 2.45.

Also a reminder that one can override channels with prepare-image (for UC16/18 images and dangerous UC20 model ones) with --snap <SNAP>=<CHANNEL> .

Changed in snapd:
status: Triaged → In Progress
Changed in snapd:
status: In Progress → Fix Committed
Changed in snapd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.