Skip to main content
Topic: Calamares: Boost.Python error in job "umount" (Read 917 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Calamares: Boost.Python error in job "umount"

This error below - happened when I tried to follow my "Full Disk Encryption" guide, with the changes for making a /boot partition inside the encrypted LVM volume:

Code: [Select]
Boost.Python error in job "umount"

<div><strong><class 'OSError'></strong></div><div>[Errno 39] Directory not empty: '/tmp/calamares-root-21_qk0sj'</div><div><br/>Traceback:</div><div><pre>File "/usr/lib/calamares/modules/umount/main.py", line 121, in run
    os.rmdir(root_mount_point)</pre></div>

Don't know if it's a coincidence or not... Is it because /mnt/boot is inside the /mnt root, which may be being unmounted first? Here's my command sequence:

Code: [Select]
# creating the partitions
parted -s /dev/sda mklabel msdos
parted -s -a optimal /dev/sda mkpart "primary" "ext4" "0%" "100%"
parted -s /dev/sda align-check optimal 1
parted -s /dev/sda set 1 boot on
parted -s /dev/sda set 1 lvm on
cryptsetup benchmark
cryptsetup --verbose --type luks1 --cipher serpent-xts-plain64 --key-size 512 --hash whirlpool --iter-time 10000 --use-random --verify-passphrase luksFormat /dev/sda1
cryptsetup luksOpen /dev/sda1 lvm-system
pvcreate /dev/mapper/lvm-system
vgcreate lvmSystem /dev/mapper/lvm-system
lvcreate -L 1G lvmSystem -n volBoot
lvcreate -L 16G lvmSystem -n volSwap
lvcreate -l +100%FREE lvmSystem -n volRoot
mkfs.fat -n BOOT /dev/lvmSystem/volBoot
mkswap /dev/lvmSystem/volSwap
mkfs.ext4 -L volRoot /dev/lvmSystem/volRoot
# mounting
swapon /dev/lvmSystem/volSwap
mount /dev/lvmSystem/volRoot /mnt
mkdir /mnt/boot
mount /dev/lvmSystem/volBoot /mnt/boot
# installing
nano /usr/lib/calamares/modules/bootloader/main.py #  prepare_bootloader(fw_type) ==> return None
 cat /home/artix/Desktop/calamares.desktop | grep "Exec"
pkexec env DISPLAY=:0 XAUTHORITY=/home/artix/.Xauthority QT_QPA_PLATFORMTHEME=gtk2 calamares

Re: Calamares: Boost.Python error in job "umount"

Reply #1
Code: [Select]
 cat /home/artix/Desktop/calamares.desktop | grep "Exec"
pkexec env DISPLAY=:0 XAUTHORITY=/home/artix/.Xauthority QT_QPA_PLATFORMTHEME=gtk2 calamares
A note about this part: it can be shortened to:
Code: [Select]
grep ^Exec= /home/artix/Desktop/calamares.desktop
and "Exec=" part can be stripped with:
Code: [Select]
sed '/^Exec/s/^Exec=//;t e;d;:e q' /home/artix/Desktop/calamares.desktop
or executed with:
Code: [Select]
$(sed '/^Exec/s/^Exec=//;t e;d;:e q' /home/artix/Desktop/calamares.desktop)

Re: Calamares: Boost.Python error in job "umount"

Reply #2
A note about this part: it can be shortened to
Thank you. I re-ran the installation with your suggestion of
Code: [Select]
calamares -d >calamares.log 2>&1
and got the following log:
Code: [Select]
...
gpg: next trustdb check due at 2022-06-08
    ..  Running ("killall", "-9", "gpg-agent")
**:**:** [6]: virtual void Calamares::JobThread::run()
    Starting job "umount" ( 30 / 30 )
**:**:** [6]: virtual Calamares::JobResult Calamares::PythonJob::exec()
    Job file "/usr/lib/calamares/modules/umount/main.py"
[PYTHON JOB]: Found gettext "en_US" in "/usr/share/locale/en_US"
    ..  Job description from pretty_name "umount" = "Unmount file systems."
**:**:** [2]: boost::python::api::object CalamaresPython::GlobalStoragePythonWrapper::value(const string&) const
    WARNING: Unknown GS key zfsPoolInfo
WARNING: [PYTHON JOB]: "Received exception while exporting zpools: 'NoneType' object has no attribute 'sort'"
Python Error:
 <class 'OSError'>
 [Errno 39] Directory not empty: '/tmp/calamares-root-v_wfj37y'
 File "/usr/lib/calamares/modules/umount/main.py", line 121, in run
    os.rmdir(root_mount_point)
 
**:**:** [1]: void Calamares::ViewManager::onInstallationFailed(const QString&, const QString&)
    ERROR: Installation failed: "Boost.Python error in job \"umount\"."
    ..  - message: "Boost.Python error in job \"umount\"."
    ..  - details: <div><strong>&lt;class 'OSError'&gt;</strong></div><div>[Errno 39] Directory not empty: '/tmp/calamares-root-v_wfj37y'</div><div><br/>Traceback:</div><div><pre>File &quot;/usr/lib/calamares/modules/umount/main.py&quot;, line 121, in run
    os.rmdir(root_mount_point)</pre></div>
**:**:** [6]: void Calamares::ViewManager::onInstallationFailed(const QString&, const QString&)
    Calamares will quit when the dialog closes.
**:**:** [6]: void Config::doNotify(bool, bool)
    Notification not sent; completion: failed
**:**:** [6]: void Config::doRestart(bool)
    mode= "never"  user wants restart? false force restart? false
Shutting down Calamares...
    ..  Finished shutdown.
Maybe an error in /usr/lib/calamares/modules/umount/main.py ? I will report this problem to Calamares and see their reply

Re: Calamares: Boost.Python error in job "umount"

Reply #3
I found a temporary solution for "Boost.Python error in job "umount"" :
Code: [Select]
sudo sed -i -e "s/os.rmdir(root_mount_point)//g" /usr/lib/calamares/modules/umount/main.py
Then, the installation will be completed almost successfully. Almost, because there's another problem - which was actually a cause of this one. At the earlier steps, the LVM volumes are getting mounted, especially the LVM volume for root:
Code: [Select]
mkfs.ext4 -L ROOT /dev/lvmSystem/volRoot
mount /dev/lvmSystem/volRoot /mnt
However, after you choose the previously-created partitions at Calamares and click "Install", for some reason it unmounts the LVM partitions at the very beginning of installation! You could see it by yourself: as soon as you click "Install", the /mnt - a mount point for LVM root partition - is gone, and nothing is being installed in reality. Luckily, I discovered that - if you somehow put /mnt in use and block it from being unmounted by Calamares, then the whole installation will be truly successful.  8)  Three ways of doing this:

1) On the earlier steps, create a "crap" partition of 32 MB size:
Code: [Select]
parted -s -a optimal /dev/sda mkpart "primary" "fat16" "0%" "32MiB"
parted -s /dev/sda align-check optimal 1
mkfs.fat -n CRAP /dev/sda1
Some time later - after mounting volRoot as /mnt - mount this "crap" inside of it:
Code: [Select]
mkdir /mnt/crap
mount /dev/sda1 /mnt/crap/
Later, after successfully completing the installation, "crap" could be unmounted and removed

2) Similar to 1) , but is much better because it's a "virtual crap" now:

Code: [Select]
sudo mkdir /mnt/vcrap
sudo mount -t tmpfs -o size=32m vcrap /mnt/vcrap/

3) Even better, just open a separate Terminal tab and
Code: [Select]
cd /mnt/
Calamares won't be able to unmount this directory as long as you're inside of it.

I think this "bug & workaround" finding is worthy of a separate thread, where I will also provide the OK vs FAIL logs for comparison. And, if that turns out a Calamares bug and not a bug of a Calamares distro-specific config, I will report to Calamares upstream then ;-)

Re: Calamares: Boost.Python error in job "umount"

Reply #4
A note about this part: it can be shortened to:
Thank you for your sed idea! + I found an improvement: it's hard for me to comprehend the sed actions at
Code: [Select]
$(sed '/^Exec/s/^Exec=//;t e;d;:e q' /home/artix/Desktop/calamares.desktop)
, so here's a much simpler alternative:
Code: [Select]
$(sed -n -e "s/^Exec=//p" /home/artix/Desktop/calamares.desktop)
To be honest, there's a different output if more than one ^Exec= in a file: your version prints only the first found, which is probably a better behavior than mine which prints all the matched&processed lines. But I think a valid .desktop file shouldn't have more than one ^Exec= lines, and at least for this calamares.desktop input both versions produce the same output  ;) Already moved to a Wiki article)

Re: Calamares: Boost.Python error in job "umount"

Reply #5
But I think a valid .desktop file shouldn't have more than one ^Exec= lines
If you have, for example, LibreOffice installed, check out /usr/share/applications/libreoffice-writer.desktop.

About the sed commands, they are explained in sed manpage.