Bug 1905247

Summary: Leapp upgrade fails when /boot/efi/ is mounted
Product: Red Hat Enterprise Linux 7 Reporter: Sergii Golovatiuk <sgolovat>
Component: leapp-repositoryAssignee: Leapp team <leapp-notifications>
Status: CLOSED ERRATA QA Contact: Jason Grosso <jgrosso>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.9CC: cfields, elicohen, fmartine, jgrosso, jhlavac, jpretori, mkluson, pstodulk
Target Milestone: rcFlags: sgolovat: needinfo-
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: leapp-repository-0.13.0-1.el7_9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-16 08:59:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergii Golovatiuk 2020-12-07 20:34:58 UTC
There are cases when EFI is not disabled but not used as well. It means that /boot/efi will be mounted but it will be empty. So, leapp will fail with the following error


Building initram disk for kernel: 4.18.0-193.29.1.el8_2.x86_64 finished
###############################################################################
2020-12-05 03:18:19.233 INFO     PID: 141387 leapp.workflow.InterimPreparation: Executing actor add_upgrade_boot_entry
2020-12-05 03:18:19.308 DEBUG    PID: 187752 leapp.workflow.InterimPreparation.add_upgrade_boot_entry: External command has started: ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upg
rade.x86_64', '-c', '/boot/grub2/grub.cfg']
2020-12-05 03:18:19.348 DEBUG    PID: 187752 leapp.workflow.InterimPreparation.add_upgrade_boot_entry: External command has finished: ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upgrade.x86_64', '-c', '/boot/grub2/grub.cfg']
2020-12-05 03:18:19.352 DEBUG    PID: 187752 leapp.workflow.InterimPreparation.add_upgrade_boot_entry: External command has started: ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upgrade.x86_64', '-c', '/boot/efi/EFI/redhat/grub.cfg']
error opening /boot/efi/EFI/redhat/grub.cfg for read: No such file or directory
2020-12-05 03:18:19.370 DEBUG    PID: 187752 leapp.workflow.InterimPreparation.add_upgrade_boot_entry: Command ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upgrade.x86_64', '-c', '/boot/efi/EFI/redhat/grub.cfg'] failed with exit code 1.
2020-12-05 03:18:19.378 DEBUG    PID: 187752 leapp.workflow.InterimPreparation.add_upgrade_boot_entry: External command has finished: ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upgrade.x86_64', '-c', '/boot/efi/EFI/redhat/grub.cfg']
2020-12-05 03:18:19.403 INFO     PID: 141387 leapp.workflow.InterimPreparation: Executing actor efi_interim_fix
2020-12-05 03:18:19.492 INFO     PID: 141387 leapp.workflow.InterimPreparation: Starting stage After of phase InterimPreparation
2020-12-05 03:18:19.502 INFO     PID: 141387 leapp.workflow: Workflow interrupted due to the FailPhase error policy
2020-12-05 03:18:19.520 INFO     PID: 141387 leapp: Answerfile will be created at /var/log/leapp/answerfile

============================================================
                           ERRORS
============================================================

2020-12-05 03:18:19.381688 [ERROR] Actor: add_upgrade_boot_entry
Message: Cannot configure bootloader.
Summary:
    Details: Command ['/usr/sbin/grubby', '--remove-kernel', '/boot/vmlinuz-upgrade.x86_64', '-c', '/boot/efi/EFI/redhat/grub.cfg'] failed with exit code 1.: error opening /boot/efi/EFI/redhat/grub.cfg for read: No such file or directory

============================================================
                       END OF ERRORS
============================================================


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================



To workaround the problem we just did the following workaround

[ -d /boot/efi ] &&  cp /boot/grub2/grub.cfg /boot/efi/EFI/redhat/grub.cfg

Comment 3 Petr Stodulka 2020-12-08 09:40:36 UTC
Ping bootloader team (jhlavac, javierm). Guys, is this valid & supported configuration? If yes, please sync with us about that. Thanks.

Comment 4 Chris Fields 2020-12-09 14:20:54 UTC
Was this bug encountered on the undercloud or overcloud?  And the upgrade was from what to what?  I'd like to understand what conditions put customer at risk of hitting this.  

Thanks

CFields

Comment 22 errata-xmlrpc 2021-02-16 08:59:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (leapp and leapp-repository bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:0569

Comment 23 Jason Grosso 2021-03-24 14:59:14 UTC
*** Bug 1905249 has been marked as a duplicate of this bug. ***