Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-113770

[RHEL 9] Leapp is not validating the grub configuration file, causing the system to drop to the grub prompt.

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • No
    • Moderate
    • rhel-upgrades
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      Leapp completed the upgrade checks and requested a reboot to continue.
      After reboot, instead of proceeding with the upgrade, the system dropped directly into the GRUB prompt.
      On inspection,  grub.cfg was found to be empty / not properly generated, which prevented GRUB from booting the upgrade kernel/initramfs.

      What is the impact of this issue to you?

      The system becomes unbootable after Leapp upgrade, requiring manual recovery steps .

      This increases downtime risk during upgrades and makes the Leapp process unreliable in production environments.

      How reproducible is this bug?:

      Everytime for both BIOS or UEFI system

      Steps to reproduce

      Empty the grub conf file 

      # > /boot/grub2/grub.cfg

      Run the leapp upgrade and reboot the system

      ====> * scan_grub_config
              Scan grub configuration files for errors.
      ====> * scan_grub_device_name
      --------------------------------------====> * add_upgrade_boot_entry
              Add new boot entry for Leapp provided initramfs.
      A reboot is required to continue. Please reboot your system.
      Debug output written to /var/log/leapp/leapp-upgrade.log============================================================
                            REPORT OVERVIEW                       
      ============================================================HIGH and MEDIUM severity reports:
          1. Leapp detected loaded kernel drivers which are no longer maintained in RHEL 10.
          2. GRUB2 core will be automatically updated during the upgrade
          3. Berkeley DB (libdb) has been detected on your systemReports summary:
          Errors:                      0
          Inhibitors:                  0
          HIGH severity reports:       2
          MEDIUM severity reports:     1
          LOW severity reports:        2
          INFO severity reports:       3Before continuing, review the full report below for details about discovered problems and possible remediation instructions:
          A report has been generated at /var/log/leapp/leapp-report.txt
          A report has been generated at /var/log/leapp/leapp-report.json============================================================
                         END OF REPORT OVERVIEW                   
      ============================================================Answerfile has been generated at /var/log/leapp/answerfile
      Reboot the system to continue with the upgrade. This might take a while depending on the system configuration.
      Make sure you have console access to view the actual upgrade process.
      [root@rhel9 ~]# 
      [root@rhel9 ~]# cat /boot/grub2/grub.cfg
      [root@rhel9 ~]# 

      We can recover system manually from grub prompt.

      Expected results

      • On RHEL 7, since grubby directly reads and edits grub.cfg, a missing or empty grub.cfg immediately causes failures (grubby: kernel not found).
      • On RHEL 9 (and later), the system uses Boot Loader Specification (BLS) 

      Therefore:

      • If grub.cfg is missing, corrupted, or empty in a Leapp upgrade, Leapp should raise an error or inhibitor before reboot.
      • The upgrade process should stop gracefully with a clear message, rather than letting the system reboot and drop to the GRUB prompt.

       Reference results

      In Red Hat Enterprise Linux 7, The grubby tool can be used to read information from, and make persistent changes to, the grub.cfg file.

      The Leapp upgrade fails with below Risk Factor :

       

      Risk Factor: high (error)
      Title: Failed to call `grubby` to list available boot entries.
      Summary: {"details": "Command ['grubby', '--info', 'ALL'] failed with exit code 1.", "stderr": "grubby: kernel not found\n"}
      [root@rhel7 ~]# > /boot/grub2/grub.cfg
      [root@rhel7 ~]# ll /boot/grub2/grub.cfg 
      rw-rr-. 1 root root 0 Sep  9 05:14 /boot/grub2/grub.cfg
      [root@rhel7 ~]# grubby --info=ALL
      grubby: kernel not found
      

       

              leapp-notifications leapp-notifications
              rhn-support-vbhope Vaibhav Bhope
              leapp-notifications leapp-notifications
              RHEL Upgrades QE Team RHEL Upgrades QE Team
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: