container: ./container destroy leaves garbage behind causing next ./container up to fail when mounting
After many previous troubles I removed a previous FreedomBox environment:
# rm -rf freedombox
Then I cloned the project to start all over again in a pristine new environment:
$ git clone https://salsa.debian.org/freedombox-team/freedombox.git
$ cd freedombox
And I try to run the container:
fioddor@bullseyedesk:~/Pys/FreedomBox/freedombox$ ./container up
[sudo] password for fioddor:
> Downloading .container/freedombox-testing-free_latest_all-amd64.img.xz
.container/freedombox-testing-free_latest_all-amd64.img. 100%[==================================================================================================================================>] 503,26M 6,12MB/s en 78s
> Downloading .container/freedombox-testing-free_latest_all-amd64.img.xz.sig
.container/freedombox-testing-free_latest_all-amd64.img. 100%[==================================================================================================================================>] 566 --.-KB/s en 0s
> Receiving GPG keys
> Verify GPG signature
gpgv: can't allocate lock for '/media/host/FreedomBox/freedombox/.container/gpg/trustedkeys.gpg'
gpgv: Firmado el sáb 18 jul 2020 00:02:29 CEST
gpgv: usando RSA clave 013D86D8BA32EAB4A6691BF85D4153D6FE188FC8
gpgv: Firma correcta de "FreedomBox CI (Continuous Integration server) <admin@freedombox.org>"
> Decompressing file .container/freedombox-testing-free_latest_all-amd64.img.xz
.container/freedombox-testing-free_latest_all-amd64.img.xz (1/1)
100 % 503,3 MiB / 3.800,0 MiB = 0,132 69 MiB/s 0:54
> Resizing disk image to 8G
mount: /media/host/FreedomBox/freedombox/.container/tmpkemzyzcc: la llamada al sistema mount(2) ha fallado: El fichero ya existe.
Traceback (most recent call last):
File "./container", line 874, in <module>
main()
File "./container", line 870, in main
subcommand_method(arguments)
File "./container", line 824, in subcommand_up
_resize_disk_image(image_file, arguments.image_size)
File "./container", line 425, in _resize_disk_image
subprocess.run(['sudo', 'mount', partition, mount_point], check=True)
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['sudo', 'mount', '/dev/mapper/loop0p1', '/media/host/FreedomBox/freedombox/.container/tmpkemzyzcc']' returned non-zero exit status 32.
The relevant part is:
mount: /media/host/FreedomBox/freedombox/.container/tmpkemzyzcc: system call mount(2) failed: File already exists.
It seems the previous ./container destroy
left some garbage behind.