[3.1][3.1+snap7] debootstrap missing

Bug #2048922 reported by Erich Eickmeyer
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Image
Confirmed
Low
Unassigned

Bug Description

It appears as though debootstrap is now missing from the snap? I'm not sure what changed, but something must have. This shows up regardless of the stable or edge branch:

$ sudo ubuntu-image -v classic -O output/ ubuntu-images/ubuntu-pi-arm64.yaml
[0] parse_image_definition
[1] calculate_states
[2] make_temporary_directories
[3] determine_output_directory
[4] build_gadget_tree
[5] prepare_gadget_tree
[6] load_gadget_yaml
[7] verify_artifact_names
[8] germinate
[9] create_chroot
Error: Error running debootstrap command "/snap/ubuntu-image/658/usr/bin/eatmydata debootstrap --arch arm64 --variant=minbase --components=main,restricted,universe,multiverse noble /tmp/ubuntu-image-17f5da20-2f3d-4398-909a-fd964047066e/chroot http://ports.ubuntu.com/ubuntu-ports/". Error is "exit status 1". Output is:
E: No such script: /snap/ubuntu-image/658/usr/share/debootstrap/scripts/noble

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Got it to work but only after symlinking /root/snap/ubuntu-image/common/usr/sbin/debootstrap to /usr/sbin/debootstrap and /root/snap/ubuntu-image/common/usr/share/debootstrap to /usr/share/debootstrap, but this is far from a long-term solution.

Revision history for this message
Paul Mars (upils) wrote :

Based on the path in the error it looks like you ran the currently 3.1 stable version, on an arm64 based machine (a raspi I suppose?). Can you try with the version in edge? (3.1+snap7)

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

This was after trying both, per the description.

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

E: No such script: /snap/ubuntu-image/658/usr/share/debootstrap/scripts/noble

It is correct that this script does not exist. What is incorrect is that something is looking for it. debootstrap 1.0.128+nmu2ubuntu3 requirement for per-release scripts for Ubuntu, and also removed the script symlinks.

So debootstrap should fall back to invoking /usr/share/debootstrap/scripts/gutsy, UNLESS the command `distro-info --series noble` fails.

The debootstrap package depends on distro-info, which in turn depends on distro-info-data.

But looking at snap 3.1+snap7 on amd64, I see that /snap/ubuntu-image/current/usr/share/distro-info is absent, so something may be wrong with the snap build, across architectures? /snap/ubuntu-image/current/snap/manifest.yaml lists distro-info=1.1ubuntu0.2 but does not list distro-info-data.

However, I cannot reproduce the reported failure with revision 696 on mantic/amd64; as a classic snap it is unsurprising that it is using /usr/share/distro-info from the host system. Erich, do you have outdated distro-info-data in your environment?

Ideally the snap would not depend on distro-info-data from the host system any more than it does debootstrap from the host system. But that would require funny mount business and I don't know to what extent that's supported in classic snaps.

Revision history for this message
Paul Mars (upils) wrote :

> But that would require funny mount business

What do you mean? We could add distro-info-data to stage-packages and be done with it, no?

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 2048922] Re: [3.1][3.1+snap7] debootstrap missing

On Wed, Jan 17, 2024 at 08:00:47AM -0000, Paul Mars wrote:
> What do you mean? We could add distro-info-data to stage-packages and be
> done with it, no?

distro-info hard-codes the path /usr/share/distro-info for its lookups.
Because this is a classic snap, when run, distro-info will not see
/usr/share/distro-info within the snap at /usr/share/distro-info - it will
be exposed in the VFS only at
/snap/ubuntu-image/current/usr/share/distro-info. So even if it's present,
distro-info won't find it.

This is why `distro-info` *ever* works at all today within the ubuntu-image
snap, since /snap/ubuntu-image/current/usr/share/distro-info is currently
empty and would otherwise cause a failure!

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
Paul Mars (upils) wrote :

> Erich, do you have outdated distro-info-data in your environment?

Erich, did you check on this?

Steve, would it be acceptable to submit a MP to distro-info to use a flag or an env var to prefix (or replace) the path of the distro-info data dir (/usr/share/distro-info)? We could then define this env var in snapcraft.yaml and so only use the distro-info shipped into the snap.

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

> Steve, would it be acceptable to submit a MP to distro-info to use a flag
> or an env var to prefix (or replace) the path of the distro-info data dir
> (/usr/share/distro-info)?

It's certainly acceptable to propose! It'll be up to the maintainer to decide whether to accept such a patch

Revision history for this message
Paul Mars (upils) wrote :

Erich: OK, good news. But the underlying issue remains so I will set this bug as low priority.

Steve: cool. I will talk about it with bdrung, thanks.

Changed in ubuntu-image:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Benjamin Drung (bdrung) wrote :

A patch for distro-info to make the distro-info data dir configurable will be accepted by at least one of the distro-info maintainers.

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.