lxc / distrobuilder

System container image builder for LXC and Incus
https://linuxcontainers.org
Apache License 2.0
548 stars 163 forks source link

Fixed device major minor parse failure #864

Closed nanjj closed 1 week ago

nanjj commented 1 week ago

The parse failure occurred occasionally, sometime deviceNumbers[1] is empty, so cause the parse failure.

The fix trim space output first then split and refact the parse logic.

stgraber commented 1 week ago

@nanjj I've had to revert this one as it caused all our VM image builds to fail.

stgraber commented 1 week ago
Error: Failed to mount image: Failed to list block devices: 7:0
259:0
259:1
time="2024-06-25T20:28:57Z" level=error msg="Failed running distrobuilder" err="Failed to mount image: Failed to list block devices: 7:0\n259:0\n259:1"
time="2024-06-25T20:28:57Z" level=info msg="Removing cache directory"

I did a quick try by changing the logic from != 2 to < 2 but that then failed with:

mkfs.vfat: unable to open /dev/loop2p1: Device or resource busy
mkfs.fat 4.2 (2021-01-31)
/root/build/cache/vm is a mountpoint
Error: Failed to create UEFI filesystem: exit status 1
time="2024-06-25T21:15:40Z" level=error msg="Failed running distrobuilder" err="Failed to create UEFI filesystem: exit status 1"
time="2024-06-25T21:15:40Z" level=info msg="Removing cache directory"

So I went with a full revert which hopefully will get us back online.