images with only core18-based snaps fail to build

Bug #1871919 reported by Robert C Jennings
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Robert C Jennings
Bionic
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Robert C Jennings

Bug Description

[Impact]

 * Building an ubuntu-cpc minimal image by default would have no snaps
installed. When a binary hook seeds a snap that has a core18 base
the build will fail when calling 'snap debug validate-seed' because
the snapd snap is missing.

 * Additionally, an image with snaps that only depend on core18 (which
isn't in the ubuntu-cpc:minimized project) would still ship 'core'.
This was found by code inspection and reported in bug #1871912.

[Test Case]

 * Build with ubuntu-cpc as that seeds lxd (now that it is based on core18). With the proposed fix the image build should succeed with lxd, core18, and snapd preseeded. The build should not fail and should not include core.

[Regression Potential]

 * Image builds fail in some fashion related to snap preseeding. It is unlikely to build an image that fails to pre-seed when booted as we call 'snap debug validate-seed' in the build, which is catching the current bug of omitting snapd with core18.

[Other Info]

 * None

[Original description]

Building an ubuntu-cpc minimal image by default would have no snaps
installed. When a binary hook seeds a snap that has a core18 base
the build will fail when calling 'snap debug validate-seed' because
the snapd snap is missing.

Additionally, an image with snaps that only depend on core18 (which
isn't in the ubuntu-cpc:minimized project) would still ship 'core'.
This was found by code inspection and reported in bug #1871912.

We want to build images that only contain the appropriate core image
and when that is not core it should have snapd preseeded.

The _snap_post_process function is meant to install snapd if core18 is the
only core snap installed or remove snapd if core is installed and snapd
was not explicitly installed. But the current logic in _snap_preseed
will never call _snap_post_process. $core_name will never be empty
with the existing logic, and even if it were that would only be for the
'core' snap and we'd miss using the 'core18' logic that pulls in snapd.
Given the case statement in _snap_post_process can handle doing the
right thing given any snap we can just call it unconditionally.

Seeding any snap via snap_preseed will evaluate the base for each snap
and seed the appropriate base. There should be no reason to explicitly
seed the 'core' snap and with snaps moving to 'core18' this will add
'core' without need.

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Robert C Jennings (rcj)
description: updated
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → Robert C Jennings (rcj)
status: Confirmed → Triaged
Robert C Jennings (rcj)
Changed in livecd-rootfs (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.660

---------------
livecd-rootfs (2.660) focal; urgency=medium

  * Remove dependencies on qemu-utils and snapd on riscv64, we don't have
    those yet, but at least we can be on parity with i386 livecd-rootfs
    already.

 -- Dimitri John Ledkov <email address hidden> Sun, 12 Apr 2020 15:42:06 +0100

Changed in livecd-rootfs (Ubuntu):
status: Fix Committed → Fix Released
Robert C Jennings (rcj)
description: updated
Robert C Jennings (rcj)
description: updated
Robert C Jennings (rcj)
Changed in livecd-rootfs (Ubuntu Eoan):
assignee: nobody → Robert C Jennings (rcj)
status: New → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Robert, or anyone else affected,

Accepted livecd-rootfs into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.620.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in livecd-rootfs (Ubuntu Eoan):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Robert C Jennings (rcj) wrote :

I have used livecd-rootfs 2.620.2 from proposed to build ec2 and gce images. EC2 currently has a mix of core and core18 based snaps while GCE has only core18 based snaps. I confirmed that snapd was seeded when core18 was the only core snap present. Boot testing each of these images confirmed that snap preseeding is working and snaps are usable. I'm going to mark this as verification-done

tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.620.2

---------------
livecd-rootfs (2.620.2) eoan; urgency=medium

  * Fix logic to ensure snapd is seeded in core18-only images (LP: #1871919)

 -- Robert C Jennings <email address hidden> Wed, 15 Apr 2020 10:05:55 -0500

Changed in livecd-rootfs (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for livecd-rootfs has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

tags: added: id-5e9058d17e58847a4a41b041
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Robert, or anyone else affected,

Accepted livecd-rootfs into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.525.45 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in livecd-rootfs (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
removed: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.525.45

---------------
livecd-rootfs (2.525.45) bionic; urgency=medium

  [ Francis Ginther ]
  * Use the linux-raspi-hwe-18.04 kernel for raspi3 classic image builds.
    (LP: #1889188)

  [ Michael Hudson-Doyle ]
  * Backport snap seeding and other fixes for live-server ISOs. (LP: #1883156)
  * Stop building and mounting the mass-rack and maas-region squashfses for
    the server-live build as subiquity does not use them any more.

  [ Dimitri John Ledkov ]
  * Run snap info on the downloaded snap, rather than against the
    store. First of all snap info doesn't have --channel argument, thus
    queries the wrong channel, and depening on the cohort, a different
    snap might be visible too. Thus seed the base of the snap revision we
    dowanloaded, rather than some random one from the store.
  * Use snap-tool to seed subiquity snap.
  * Subiquity: install linux-firmware in the installer layer, to make
    firmware blobs available in the live session. LP: #1847835

  [ Robert C Jennings ]
  * Fix logic to ensure snapd is seeded in core18-only images (LP: #1871919)

 -- Michael Hudson-Doyle <email address hidden> Wed, 22 Jul 2020 14:44:38 +1200

Changed in livecd-rootfs (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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