I was previously able to reproduce reliably this behavior but I am not anymore, which is at the same time a good and a bad news. Meanwhile, I now it a similar issue, but at the update_bootloader stage.
[18] update_bootloader
Adding 'local diversion of /etc/grub.d/30_os-prober to /etc/grub.d/30_os-prober.dpkg-divert'
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.5.0-9-generic
Found initrd image: /boot/initrd.img-6.5.0-9-generic
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing 'local diversion of /etc/grub.d/30_os-prober to /etc/grub.d/30_os-prober.dpkg-divert'
umount: /home/paul/scratch/debootstrap-2/scratch/loopback/proc: target is busy.
umount: /home/paul/scratch/debootstrap-2/scratch/loopback: target is busy.
duration: 1.053857891s
Error: teardown failed: teardown command "/usr/bin/umount --recursive /home/paul/scratch/debootstrap-2/scratch/loopback/proc" failed. Output:
umount: /home/paul/scratch/debootstrap-2/scratch/loopback/proc: target is busy.
I was previously able to reproduce reliably this behavior but I am not anymore, which is at the same time a good and a bad news. Meanwhile, I now it a similar issue, but at the update_bootloader stage.
[18] update_bootloader d/30_os- prober to /etc/grub. d/30_os- prober. dpkg-divert' 6.5.0-9- generic img-6.5. 0-9-generic d/30_os- prober to /etc/grub. d/30_os- prober. dpkg-divert' scratch/ debootstrap- 2/scratch/ loopback/ proc: target is busy. scratch/ debootstrap- 2/scratch/ loopback: target is busy. scratch/ debootstrap- 2/scratch/ loopback/ proc" failed. Output: scratch/ debootstrap- 2/scratch/ loopback/ proc: target is busy.
Adding 'local diversion of /etc/grub.
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing 'local diversion of /etc/grub.
umount: /home/paul/
umount: /home/paul/
duration: 1.053857891s
Error: teardown failed: teardown command "/usr/bin/umount --recursive /home/paul/
umount: /home/paul/
teardown command "/usr/bin/umount /home/paul/ scratch/ debootstrap- 2/scratch/ loopback" failed. Output: scratch/ debootstrap- 2/scratch/ loopback: target is busy.
umount: /home/paul/
This is also not always happening and mounted dirs can be umounted manually after the build failed. So I suspect a race condition again.