RHEL7: "leapp upgrade" fails in reboot phase with message "/usr/bin/bash: /usr/bin/python3: No such file or directory" then enters emergency mode
Environment
- Red Hat Enterprise Linux 7
- Leapp
Issue
-
After rebooting once
leapp upgradeexecuted successfully, the boot falls into emergency and shows the following message on the console:localhost upgrade: /usr/bin/bash: /usr/bin/python3: No such file or directory -
The issue happens when an
alternativeforpython3is configured and pointing to an incorrect path.
Resolution
-
Check if an alternative for
python3exists:# alternatives --display python3 -
If it exists, remove the alternative:
# alternatives --remove python3 <path>
Root Cause
An incorrect alternative points to the wrong path for the python3 binary. During the reboot phase, Leapp uses python3 instead of python2.7, which causes the issue if the binary can't be found.
Diagnostic Steps
-
Check if the error is present in the
rdsosreport.txt:# grep python3 /run/initramfs/rdsosreport.txt [...] [ 406.572247] localhost upgrade[23373]: /usr/bin/bash: /usr/bin/python3: No such file or directory
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.