LXD snap not being installed from the right channel when running unminimize

Bug #2036725 reported by Utkarsh Gupta
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Utkarsh Gupta
Jammy
Fix Released
Undecided
Unassigned
Lunar
Won't Fix
Undecided
Unassigned

Bug Description

[Impact]
========

There's a step in `unminimize` where it installs the LXD snap. The problem is that it doesn't mention any channel where to install it from. So often it happens that we have the LXD snap on 20.04 or 22.04 from the latest/stable channel (as that's the default!).

However, we should be installing this from stable/ubuntu-20.04 or stable/ubuntu-22.04 (or equivalent) channel.

[Test Plan]
===========

1. Create an image with the changes:
$ ubuntu-bartender --build-provider gce --hook-extras-dir "$(pwd)/cpc_packaging.extra" --livecd-rootfs-branch ubuntu/jammy -- --series jammy --project ubuntu-cpc --image-target gce --subproject minimized

2. Boot into that image. Ensure it's a minimized image.

3. Run update and unminimize.
# apt update
# unminimize

4. Check the snap list to see the right channel being used.
# snap list | grep 'lxd' | awk '{print $4}'

[Where Problems Could Occur]
=============================

There's very smol room for error especially when the patch only introduces the following to the snap install call: --channel="stable/ubuntu-$VERSION_ID"

But things might behave differently IFF someone has tampered their /etc/os-release OR/AND fiddled with the unminimize script to do a different thing. :)

[OG Bug Report]
===============

In the past, when running unminimize, we'd directly do:
snap install lxd
(cf: https://git.launchpad.net/livecd-rootfs/tree/live-build/auto/build#n322)

which defaults to the latest/stable channel. However, whilst working on enhancing unminimize, it was observed that we install this snap from the stable/ubuntu-<version> channel instead.

This was also noted as a failure when running the CTF tests:
`lxd installed from latest/stable, not stable/ubuntu-23.10`

Related branches

Utkarsh Gupta (utkarsh)
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → Utkarsh Gupta (utkarsh)
Utkarsh Gupta (utkarsh)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
livecd-rootfs (23.10.44) mantic; urgency=medium

  * Fix the subarch used in the hook to identify images for sifive
    unmatched. LP: #2037060.

 -- Steve Langasek <email address hidden> Fri, 22 Sep 2023 10:58:57 -0700

Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

This bug has an upload in the unapproved queue, but does not have an SRU bug template [1].
Could you please add it? Thanks!

[1] https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Marking as incomplete pending the SRU template.

Changed in livecd-rootfs (Ubuntu Jammy):
status: New → Incomplete
Changed in livecd-rootfs (Ubuntu Lunar):
status: New → Incomplete
Utkarsh Gupta (utkarsh)
description: updated
Utkarsh Gupta (utkarsh)
description: updated
Changed in livecd-rootfs (Ubuntu Jammy):
status: Incomplete → New
Changed in livecd-rootfs (Ubuntu Lunar):
status: Incomplete → New
Utkarsh Gupta (utkarsh)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of livecd-rootfs to jammy-proposed has been rejected from the upload queue for the following reason: "cruft in upload (.idea*/)".

Revision history for this message
Philip Roche (philroche) wrote :

Apologies RE jammy upload. I have now re-uploaded Jammy livecd-rootfs 2.765.30 again without any '.idea' directory cruft.

Revision history for this message
Steve Langasek (vorlon) wrote :

An upload of livecd-rootfs to lunar-proposed has been rejected from the upload queue for the following reason: ".idea cruft, needs reuploaded".

Revision history for this message
Philip Roche (philroche) wrote :

Apologies RE lunar upload. I have now re-uploaded Lunar livecd-rootfs 2.828.2 again without any '.idea' directory cruft - see unapproved queue @ https://launchpad.net/ubuntu/lunar/+queue?queue_state=1&queue_text=livecd-rootfs

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Utkarsh, or anyone else affected,

Accepted livecd-rootfs into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.828.3 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-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. 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 Lunar):
status: New → Fix Committed
tags: added: verification-needed verification-needed-lunar
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Utkarsh, or anyone else affected,

Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.765.32 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 Jammy):
status: New → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
livecd-rootfs (2.828.3) lunar; urgency=medium

  [ Heinrich Schuchardt ]
  * arm: fix console parameter for ARM cloud-images (LP: #2036730)

livecd-rootfs (2.828.2) lunar; urgency=medium

  [ Steve Langasek ]
  * The chroot tmpfs mount should only be /var/lib/apt/lists, not
    /var/lib/apt; the latter breaks changes to /var/lib/apt/extended_states.
    (LP: #2036195).

livecd-rootfs (2.828.1) lunar; urgency=medium

  * Fix unminimize to correctly list packages. (LP: #1996489)
  * Install LXD snap from stable/ubuntu-<version> channel. (LP: #2036725)

 -- Steve Langasek <email address hidden> Thu, 07 Dec 2023 08:51:51 -0800

Changed in livecd-rootfs (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I made a mistake in releasing this for lunar, as this bug had not been verified yet.

Revision history for this message
Philip Roche (philroche) wrote :

As per https://bugs.launchpad.net/cloud-images/+bug/1996489/comments/18

> After some investigation following upcoming changes to LXD and seed the Jammy proposal WRT snap install @ https://code.launchpad.net/~utkarsh/livecd-rootfs/+git/livecd-rootfs/+merge/452742 is not correct as for LTS we need to install targeting a specific LTS track and channel.
>
> Focal has track/channel set to `4.0/stable/ubuntu-20.04` in seed @ https://ubuntu-archive-team.ubuntu.com/seeds/ubuntu.focal/server
> Groovy has no channel set @ https://git.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/+git/ubuntu/tree/server?h=groovy#n59
> Jammy has track/channel set to `5.0/stable/ubuntu-22.04` in seed @ https://ubuntu-archive-team.ubuntu.com/seeds/ubuntu.jammy/server
> Impish has no channel set @ https://git.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/+git/ubuntu/tree/server?h=impish#n59
>
> As such I propose we block this jammy SRU until this is resolved.

and

> Comment from @sdeziel in Jammy MP https://code.launchpad.net/~utkarsh/livecd-rootfs/+git/livecd-rootfs/+merge/452742 makes a lot of sense for the unminimzine part related to snap installs.
>
>> Since `lxd-installer` will need to be modified to pull the snap from the right channel when we know it, it might be best to rely on `lxd-installer` to do the right thing.
>>
>> As such, I'd propose to simply run the `lxd-installer` prior to purging it.

I will mark this as block-proposed-jammy until resolved.

tags: added: block-proposed-jammy
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hey there!

I've tested the update from -proposed pockets of all the releases. Sadly, the LTS release uses a different channel and thus we'll have to re-do that bit but the non-LTS releases are fine.

The unminimize script works as intended on Lunar, marking that as verification-done, however I'll propose a new fix for all the releases now.

tags: added: verification-done-lunar
removed: block-proposed-jammy verification-needed-lunar
Changed in livecd-rootfs (Ubuntu):
status: Fix Released → New
Changed in livecd-rootfs (Ubuntu Jammy):
status: Fix Committed → New
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

It turned out that since `lxd-installer` will need to be modified to pull the snap from the right channel when we know it (whatever channel is used when the LTS is released), it might be best to rely on `lxd-installer` to do the right thing.

For LTS, the snap channel doesn't necessarily would be XX.04. For instance,
For jammy, it is: 5.0/stable/ubuntu-22.04 (set in the seed definition)
For focal, it is: 4.0/stable/ubuntu-20.04 (set in the seed definition)
...and so on.

OTOH, for non-LTS releases, there's no set channel. For eg: see Groovy, Impish, et al, et al.

As such, we propose to simply run the `lxd-installer` prior to purging it as that will do the right thing from the right channel.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Utkarsh, or anyone else affected,

Accepted livecd-rootfs into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.828.4 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-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. 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 Lunar):
status: Fix Released → Fix Committed
tags: added: verification-needed-lunar
removed: verification-done-lunar
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Utkarsh, or anyone else affected,

Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.765.33 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 Jammy):
status: New → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Utkarsh, or anyone else affected,

Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.765.34 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hey!

I've tested 2.765.34 from jammy-proposed. I can confirm that `lxd --version` call does the right thing and lxd-installer's scripts install the right version of LXD (from the right channel).

And I can confirm the same for Lunar (though it was right before, too). But even the new approach works perfectly fine. I've tested 2.828.4 from lunar-proposed

description: updated
tags: added: verification-done-jammy verification-done-lunar
removed: verification-needed-jammy verification-needed-lunar
Philip Roche (philroche)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
livecd-rootfs (2.765.34) jammy; urgency=medium

  * Remove comments in the debian/control dependencies as it was causing the
    package build to fail.

livecd-rootfs (2.765.33) jammy; urgency=medium

  [ Steve Langasek ]
  * Use losetup instead of kpartx to resolve race conditions in riscv64
    image builds. LP: #2045797.

  [ Utkarsh Gupta ]
  * unminimize: Use lxd-installer to install LXD itself (LP: #2036725)

livecd-rootfs (2.765.32) jammy; urgency=medium

  [ Heinrich Schuchardt ]
  * arm: fix console parameter for ARM cloud-images (LP: #2036730)

livecd-rootfs (2.765.31) jammy; urgency=medium

  [ John Chittum ]
  * fix: add 6.5 kernel apparmor features to livecd-rootfs based on
    features of 6.5 in ubuntu/mantic. This will roll as HWE. (LP: #2037567)

livecd-rootfs (2.765.30) jammy; urgency=medium

  * Enable snap preseeding with ppc64el images where /boot/vmlinux is used
    instead of /boot/vmlinuz. (LP: #2038957)

livecd-rootfs (2.765.29) jammy; urgency=medium

  [ Steve Langasek ]
  * The chroot tmpfs mount should only be /var/lib/apt/lists, not
    /var/lib/apt; the latter breaks changes to /var/lib/apt/extended_states.
    (LP: #2036195).

livecd-rootfs (2.765.28) jammy; urgency=medium

  * Fix unminimize to correctly list packages. (LP: #1996489)
  * Install LXD snap from stable/ubuntu-<version> channel. (LP: #2036725)

livecd-rootfs (2.765.27) jammy; urgency=medium

  [ Thomas Bechtold ]
  * Do not modify /etc/ssh/sshd_config for ubuntu-cpc
    project builds (LP: #1968873)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Mon, 15 Jan 2024 16:41:18 +0100

Changed in livecd-rootfs (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) 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.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hey!

We've found some issues with the new approach and it shouldn't be landing in Lunar. So I'm adding the block-proposed tags.

tags: added: block-proposed-lunar verification-failed-lunar
removed: verification-done-lunar
Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package removed from archive

The version of livecd-rootfs in the proposed pocket of Lunar that was purported to fix this bug report has been removed because one or more bugs that were to be fixed by the upload have failed verification and been in this state for more than 10 days.

Changed in livecd-rootfs (Ubuntu Lunar):
status: Fix Committed → Confirmed
Revision history for this message
Philip Roche (philroche) wrote :

@utkarsh shouldn't this bug target all the way back to Focal and possibly Bionic too?

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

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

---------------
livecd-rootfs (24.04.21) noble; urgency=medium

  * live-build/functions: avoid losetup -P as it appears to race with udev and
    do it a bit more by-hand instead. (LP: #2045586)

 -- Michael Hudson-Doyle <email address hidden> Thu, 25 Jan 2024 10:28:38 +1300

Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.04 (Lunar Lobster) has reached end of life, so this bug will not be fixed for that specific release.

Changed in livecd-rootfs (Ubuntu Lunar):
status: Confirmed → Won't Fix
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.