ubuntu-image command crash on 22.04 Jammy LxD VM

Bug #1970150 reported by lo
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
High
Unassigned

Bug Description

1. Using stable channel of ubuntu-image (1.11+snap1):
DEBUG:ubuntu-image:-> [11] populate_filesystems
ERROR:ubuntu-image:COMMAND FAILED: sudo mount -oloop work/volumes/pc/part3.img /tmp/tmp81dyopik/root-mount
ERROR:ubuntu-image:
ERROR:ubuntu-image:sudo: account validation failure, is your account locked?
sudo: a password is required

2. When switch to use edge channel (2.1+snap7), there is no previous error but another:
[10] populate_prepare_partitions
Error: Error running mkfs with content: exec: "mkfs.vfat": executable file not found in $PATH

[Reproduction steps]
lxc launch images:ubuntu/jammy/cloud iot-jammy-test --vm
lxc exec iot-jammy-test bash

su - ubuntu
mkdir work
cd work

# Install packages required for building image.
sudo apt-get install snapd wget git snapcraft
sudo snap install ubuntu-image --classic

# Build gadget
git clone -b classic https://github.com/snapcore/pc-amd64-gadget.git
cd pc-amd64-gadget
make
cd -

# Download base image
wget -O rootfs.tar.xz https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-root.tar.xz
mkdir cloud-image
cd cloud-image
sudo tar Jxf ../rootfs.tar.xz
cd -

# Build image
$ sudo /snap/bin/ubuntu-image classic -d -O out -w work -f cloud-image -a arm64 /home/ubuntu/work/pc-amd64-gadget/install

---
https://forum.snapcraft.io/t/ubuntu-image-command-crashed/23249/42

description: updated
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :

Cannot reproduce the issue on 20.04 Focal LxD VM.

ubuntu-image: 1.11+snap1

Here is the log:
DEBUG:ubuntu-image:-> [ 0] make_temporary_directories
DEBUG:ubuntu-image:-> [ 1] prepare_gadget_tree
DEBUG:ubuntu-image:-> [ 2] prepare_image
DEBUG:ubuntu-image:-> [ 3] load_gadget_yaml
DEBUG:ubuntu-image:-> [ 4] populate_rootfs_contents
DEBUG:ubuntu-image:-> [ 5] populate_rootfs_contents_hooks
...
DEBUG:ubuntu-image:-> [ 6] generate_disk_info
DEBUG:ubuntu-image:-> [ 7] calculate_rootfs_size
DEBUG:ubuntu-image:-> [ 8] pre_populate_bootfs_contents
DEBUG:ubuntu-image:-> [ 9] populate_bootfs_contents
DEBUG:ubuntu-image:No bootloader bits prepared in the rootfs - skipping boot copies.
DEBUG:ubuntu-image:-> [10] prepare_filesystems
DEBUG:ubuntu-image:-> [11] populate_filesystems
DEBUG:ubuntu-image:-> [12] make_disk
DEBUG:ubuntu-image:-> [13] generate_manifests
DEBUG:ubuntu-image:-> [14] finish
DEBUG:ubuntu-image:-> [15] close

description: updated
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
description: updated
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
Changed in ubuntu-image:
importance: Undecided → High
Revision history for this message
William Wilson (jawn-smith) wrote :

A new snap has been released to the edge channel. Can you test with that snap? I expect it will resolve this issue.

Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :

@William

The issue is gone after I upgrade ubuntu-image to 2.2+snap8.

$ sudo snap refresh ubuntu-image --edge
ubuntu-image (edge) 2.2+snap8 from Canonical✓ refreshed
$ sudo /snap/bin/ubuntu-image classic -d -O out -w work -f cloud-image -a arm64 /home/ubuntu/work/pc-amd64-gadget/install
[0] make_temporary_directories
[1] prepare_gadget_tree
[2] run_live_build
[3] load_gadget_yaml
WARNING: volumes:pc:structure:2:filesystem_label used for defining partition roles; use role instead
[4] populate_rootfs_contents
[5] populate_rootfs_contents_hooks
[6] prepare_classic_image
[7] generate_disk_info
[8] calculate_rootfs_size
[9] populate_bootfs_contents
[10] populate_prepare_partitions
[11] make_disk
[12] generate_manifest
[13] finish

Changed in ubuntu-image:
status: New → Fix Committed
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.