FS#70938 - [libguestfs] virt-builder fails to create image

Attached to Project: Community Packages
Opened by Eric Krebs (ekrebs) - Tuesday, 18 May 2021, 19:49 GMT
Last edited by Robin Broda (coderobe) - Thursday, 27 May 2021, 21:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Robin Broda (coderobe)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When running virt-builder the command fails and no image is produced.
The relevant line in the output when it fails seems to be:
supermin: root UUID is longer than 16 bytes

I think this has been fixed upstream

Additional info:
* package version: 1.42.0-5

This seems like it is caused by changes to the file package

It seems like this is fixed upstream:
https://github.com/libguestfs/libguestfs/commit/278d0d3226f4bdb7c6586986ca46d0a25c976fe4

Potentially relevant URLS:
libguestfs@redhat.com/msg21721.html"> https://www.mail-archive.com/libguestfs@redhat.com/msg21721.html
https://bbs.archlinux.org/viewtopic.php?id=265321

Steps to reproduce:
Run:
LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 virt-builder fedora-34 -o /tmp/fedora-34.img

produces the following output:
[ 6.6] Downloading: http://builder.libguestfs.org/fedora-34.xz
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: create: flags = 0, handle = 0x55c103ed97e0, program = virt-builder
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
[ 7.4] Planning how to build this image
[ 7.4] Uncompressing
[ 14.1] Opening the new disk
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: create: flags = 0, handle = 0x55c103ed00d0, program = virt-builder
libguestfs: trace: set_network true
libguestfs: trace: set_network = 0
libguestfs: trace: add_drive "/tmp/fedora-34.img" "format:raw" "cachemode:unsafe"
libguestfs: trace: add_drive = 0
libguestfs: trace: launch
libguestfs: trace: max_disks
libguestfs: trace: max_disks = 255
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: version
libguestfs: trace: version = <struct guestfs_version = major: 1, minor: 42, release: 0, extra: , >
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
libguestfs: launch: program=virt-builder
libguestfs: launch: version=1.42.0
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsz2161j
libguestfs: launch: umask=0022
libguestfs: launch: euid=1000
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-1000/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-1000/appliance.d
supermin: version: 5.2.0
supermin: package handler: arch/pacman
supermin: acquiring lock on /var/tmp/.guestfs-1000/lock
supermin: if-newer: output does not need rebuilding
libguestfs: finished building supermin appliance
libguestfs: begin testing qemu features
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: checking for previously cached test results of /usr/bin/qemu-system-x86_64, in /var/tmp/.guestfs-1000
libguestfs: loading previously cached test results
libguestfs: qemu version: 6.0
libguestfs: qemu mandatory locking: yes
libguestfs: qemu KVM: enabled
libguestfs: trace: get_backend_setting "force_tcg"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_sockdir
libguestfs: trace: get_sockdir = "/run/user/1000"
libguestfs: finished testing qemu features
libguestfs: trace: get_backend_setting "gdb"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: command: run: file
libguestfs: command: run: \ -- /var/tmp/.guestfs-1000/appliance.d/root
/usr/bin/qemu-system-x86_64 \
-global virtio-blk-pci.scsi=off \
-no-user-config \
-enable-fips \
-nodefaults \
-display none \
-machine accel=kvm:tcg \
-cpu host \
-m 768 \
-no-reboot \
-rtc driftfix=slew \
-no-hpet \
-global kvm-pit.lost_tick_policy=discard \
-kernel /var/tmp/.guestfs-1000/appliance.d/kernel \
-initrd /var/tmp/.guestfs-1000/appliance.d/initrd \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-pci,rng=rng0 \
-device virtio-scsi-pci,id=scsi \
-drive file=/tmp/fedora-34.img,cache=unsafe,format=raw,id=hd0,if=none \
-device scsi-hd,drive=hd0 \
-drive file=/var/tmp/.guestfs-1000/appliance.d/root,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw \
-device scsi-hd,drive=appliance \
-device virtio-serial-pci \
-serial stdio \
-device sga \
-chardev socket,path=/run/user/1000/libguestfsuaNepB/guestfsd.sock,id=channel0 \
-device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
-netdev user,id=usernet,net=169.254.0.0/16 \
-device virtio-net-pci,netdev=usernet \
-append "panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=UUID=90050eb7-6a2c-419c-ffffb872-e8193fd654dc selinux=0 guestfs_verbose=1 guestfs_network=1 TERM=xterm-kitty"
qemu-system-x86_64: -enable-fips: warning: -enable-fips is deprecated, please build QEMU with the `libgcrypt` library as the cryptography provider to enable FIPS compliance
libguestfs: responding to serial console Device Status Report
\x1b[1;256r\x1b[256;256H\x1b[6n
Google, Inc.
Serial Graphics Adapter 04/27/17
SGABIOS $Id$ (pbonzini@donizetti) gio 27 apr 2017, 08.36.57, UTC
Term: 80x24
4 0
SeaBIOS (version ArchLinux 1.14.0-1)


iPXE (http://ipxe.org) 00:05.0 C100 PCI2.10 PnP PMM+2FF91230+2FEF1230 C100



Booting from ROM...
\x1b[2J[ 0.101680] usbserial: usb_serial_init - registering generic driver failed
[ 0.102523] usbserial: usb_serial_init - returning with error -19
supermin: mounting /proc
supermin: ext2 mini initrd starting up: 5.2.0 glibc
supermin: cmdline: panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=UUID=90050eb7-6a2c-419c-ffffb872-e8193fd654dc selinux=0 guestfs_verbose=1 guestfs_network=1 TERM=xterm-kitty
supermin: uptime: 0.19 0.00
supermin: mounting /sys
supermin: internal insmod crc32-pclmul.ko
supermin: internal insmod crc32c-intel.ko
supermin: internal insmod crct10dif-pclmul.ko
supermin: internal insmod crc32_generic.ko
supermin: internal insmod crc32c_generic.ko
supermin: internal insmod nfit.ko
supermin: internal insmod ata_piix.ko
supermin: internal insmod virtio_blk.ko
supermin: internal insmod rng-core.ko
supermin: internal insmod virtio-rng.ko
supermin: internal insmod virtio_console.ko
supermin: internal insmod crypto_engine.ko
supermin: internal insmod virtio_crypto.ko
supermin: internal insmod failover.ko
supermin: internal insmod net_failover.ko
supermin: internal insmod virtio_net.ko
supermin: internal insmod nd_btt.ko
supermin: internal insmod nd_pmem.ko
supermin: internal insmod nd_virtio.ko
supermin: internal insmod virtio_pmem.ko
supermin: internal insmod rpmsg_core.ko
supermin: internal insmod rpmsg_ns.ko
supermin: internal insmod virtio_rpmsg_bus.ko
supermin: internal insmod virtio_scsi.ko
supermin: internal insmod virtio_balloon.ko
supermin: internal insmod virtio_dma_buf.ko
supermin: internal insmod virtio_input.ko
supermin: internal insmod virtio_mem.ko
supermin: internal insmod virtio_mmio.ko
supermin: internal insmod virtio_pci_modern_dev.ko
supermin: internal insmod virtio_pci.ko
supermin: internal insmod vdpa.ko
supermin: internal insmod virtio_vdpa.ko
supermin: internal insmod jbd2.ko
supermin: internal insmod mbcache.ko
supermin: internal insmod crc16.ko
supermin: internal insmod ext4.ko
supermin: internal insmod fuse.ko
supermin: internal insmod virtiofs.ko
supermin: internal insmod crc-itu-t.ko
supermin: internal insmod crc4.ko
supermin: internal insmod crc64.ko
supermin: internal insmod crc7.ko
supermin: internal insmod crc8.ko
supermin: internal insmod libcrc32c.ko
supermin: root UUID is longer than 16 bytes
[ 0.712382] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 0.713283] CPU: 0 PID: 1 Comm: init Not tainted 5.12.4-arch1-2 #1
[ 0.714423] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ArchLinux 1.14.0-1 04/01/2014
[ 0.715523] Call Trace:
[ 0.715862] dump_stack+0x76/0x94
[ 0.716256] panic+0x112/0x2e8
[ 0.716620] do_exit.cold+0xa7/0xb3
[ 0.717213] ? vfs_write+0x14e/0x290
[ 0.717734] ? vfs_write+0x14e/0x290
[ 0.718196] do_group_exit+0x33/0xa0
[ 0.718620] __x64_sys_exit_group+0x14/0x20
[ 0.719154] do_syscall_64+0x33/0x40
[ 0.719572] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 0.720169] RIP: 0033:0x441221
[ 0.720690] Code: c0 ff ff ff be e7 00 00 00 ba 3c 00 00 00 eb 16 66 0f 1f 84 00 00 00 00 00 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00
[ 0.723202] RSP: 002b:00007ffe0988fd78 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[ 0.724270] RAX: ffffffffffffffda RBX: 00000000004b3230 RCX: 0000000000441221
[ 0.725343] RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
[ 0.726223] RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00000000004b3600
[ 0.727080] R10: 0000000000441fb7 R11: 0000000000000246 R12: 00000000004b3230
[ 0.728019] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
[ 0.728918] Kernel Offset: 0x21e00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 0.730233] Rebooting in 1 seconds..
libguestfs: child_cleanup: 0x55c103ed00d0: child process died
libguestfs: sending SIGTERM to process 12754
libguestfs: qemu maxrss 193012K
libguestfs: trace: launch = -1 (error)
virt-builder: error: libguestfs error: guestfs_launch failed, see earlier
error messages

If reporting bugs, run virt-builder with debugging enabled and include the
complete output:

virt-builder -v -x [...]
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55c103ed00d0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsz2161j
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /run/user/1000/libguestfsuaNepB
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55c103ed97e0 (state 0)
This task depends upon

Closed by  Robin Broda (coderobe)
Thursday, 27 May 2021, 21:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  libguestfs 1.44.1-3
Comment by Toolybird (Toolybird) - Tuesday, 18 May 2021, 21:08 GMT
Is definitely fixed in latest upstream release.

Note for Arch maintainer - when updating to libguestfs-1.44.1 be sure to add this to ./configure

--with-guestfs-path=/usr/lib/guestfs

otherwise the pkg will fail miserably. More info here:

https://bugzilla.redhat.com/show_bug.cgi?id=1915646
Comment by Anonymous (reallybmn) - Friday, 21 May 2021, 11:23 GMT
I installed libguestfs today.

guestfish --version
guestfish 1.44.1

When I try to use:
virt-resize --expand /dev/sda1 kali_linux.img outdisk

I get the following output:

virt-resize: error: libguestfs error: cannot find any suitable libguestfs
supermin, fixed or old-style appliance on LIBGUESTFS_PATH (search path:
/usr/local/lib/guestfs)

It looks like the latest version was not build as Toolybird suggested.

Loading...