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

Leapp fails with traceback while scanning source kernel if usual formatting of 'nevra' is modified with rpmmacros

    • No
    • None
    • rhel-sst-upgrades
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • x86_64
    • None

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

      System with /root/.rpmmacros file that changes usual nevra formatting

       From 
          kernel-4.18.0-477.10.1.el8_8.x86_64
       To
          kernel-4.18.0-477.10.1.el8_8 (x86_64)

      Please provide the package NVR for which bug is seen:

       leapp-0.17.0-1.el8.noarch.rpm  
       leapp-deps-0.17.0-1.el8.noarch.rpm                                                                                          systemd-container-239-74.el8_8.x86_64.rpm                                                                            leapp-upgrade-el8toel9-deps-0.20.0-2.el8.noarch.rpm                                                            python3-leapp-0.17.0-1.el8.noarch.rpm                                                                                    leapp-upgrade-el8toel9-0.20.0-2.el8.noarch.rpm                                                                   

      How reproducible:

       100%

      Steps to reproduce

      1. Create a file /root/.rpmmacros and add line
          %_query_all_fmt    %%{name}%%{version}%%{release} (%%{arch})
      2. Check that you see the output of kernel as such:
          kernel-4.18.0-477.10.1.el8_8 (x86_64)
      3. Install leapp packages
      4. Perform leapp preupgrade

      Expected results

       Leapp should be able to find installed kernel packages 

      Actual results

      ====> * scan_source_kernel
              Scan the source system kernel.
      Process Process-294:
      Traceback (most recent call last):
        File "/usr/lib64/python3.6/multiprocessing/process.py", line 258, in _bootstrap
          self.run()
        File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run
          self._target(*self._args, **self._kwargs)
        File "/usr/lib/python3.6/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
          actor_instance.run(*args, **kwargs)
        File "/usr/lib/python3.6/site-packages/leapp/actors/_init_.py", line 289, in run
          self.process(*args)
        File "/etc/leapp/repos.d/system_upgrade/common/actors/scansourcekernel/actor.py", line 18, in process
          scan_source_kernel_lib.scan_source_kernel()
        File "/etc/leapp/repos.d/system_upgrade/common/actors/scansourcekernel/libraries/scan_source_kernel.py", line 16, in scan_source_kernel
          kernel_pkg_info = kernel_lib.get_kernel_pkg_info_for_uname_r(uname_r)
        File "/etc/leapp/repos.d/system_upgrade/common/libraries/kernel.py", line 109, in get_kernel_pkg_info_for_uname_r
          provided_uname = get_uname_r_provided_by_kernel_pkg(kernel_pkg_nevra)  # We know all packages provide a uname
        File "/etc/leapp/repos.d/system_upgrade/common/libraries/kernel.py", line 63, in get_uname_r_provided_by_kernel_pkg
          callback_linebuffered=lambda fd, value: None)['stdout']
        File "/usr/lib/python3.6/site-packages/leapp/libraries/stdlib/_init_.py", line 192, in run
          result=result
      leapp.libraries.stdlib.CalledProcessError: Command ['rpm', '-q', '--provides', 'kernel-core-4.18.0-477.10.1.el8_8 (x86_64)'] failed with exit code 1.
      2024-08-29 11:54:20.677 ERROR    PID: 13890 leapp.workflow.FactsCollection: Actor scan_source_kernel has crashed: Traceback (most recent call last):
        File "/usr/lib/python3.6/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
          actor_instance.run(*args, **kwargs)
        File "/usr/lib/python3.6/site-packages/leapp/actors/_init_.py", line 289, in run
          self.process(*args)
        File "/etc/leapp/repos.d/system_upgrade/common/actors/scansourcekernel/actor.py", line 18, in process
          scan_source_kernel_lib.scan_source_kernel()
        File "/etc/leapp/repos.d/system_upgrade/common/actors/scansourcekernel/libraries/scan_source_kernel.py", line 16, in scan_source_kernel
          kernel_pkg_info = kernel_lib.get_kernel_pkg_info_for_uname_r(uname_r)
        File "/etc/leapp/repos.d/system_upgrade/common/libraries/kernel.py", line 109, in get_kernel_pkg_info_for_uname_r
          provided_uname = get_uname_r_provided_by_kernel_pkg(kernel_pkg_nevra)  # We know all packages provide a uname
        File "/etc/leapp/repos.d/system_upgrade/common/libraries/kernel.py", line 63, in get_uname_r_provided_by_kernel_pkg
          callback_linebuffered=lambda fd, value: None)['stdout']
        File "/usr/lib/python3.6/site-packages/leapp/libraries/stdlib/_init_.py", line 192, in run
          result=result
      leapp.libraries.stdlib.CalledProcessError: Command ['rpm', '-q', '--provides', 'kernel-core-4.18.0-477.10.1.el8_8 (x86_64)'] failed with exit code 1.

       

      ===================================================================================================
      Actor scan_source_kernel unexpectedly terminated with exit code: 1 - Please check the above details
      ===================================================================================================

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

      ============================================================
                            REPORT OVERVIEW                       
      ============================================================

       

      Root Cause:

      Leapp uses the output of command `rpm -q --whatprovides 'kernel-uname-r'` as argument for `rpm -q --provides <kernel-core>` command.

      This command breaks if the first output format is not default since --provides needs exact nevra to be matched.

      ~~~

      2024-08-29 09:42:46.926 INFO     PID: 58936 leapp.workflow.FactsCollection: Executing actor scan_source_kernel 
      2024-08-29 09:42:47.16  DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has started: ['rpm', '-q', '--whatprovides', 'kernel-uname-r']
      2024-08-29 09:42:47.118 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: kernel-3.10.0-1160.114.2.el7 (x86_64)
      2024-08-29 09:42:47.180 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: kernel-3.10.0-1160.118.1.el7 (x86_64)
      2024-08-29 09:42:47.238 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: kernel-3.10.0-1160.119.1.el7 (x86_64) <---- The fault is generated here******

      2024-08-29 09:42:47.243 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has finished: ['rpm', '-q', '--whatprovides', 'kernel-uname-r']
      2024-08-29 09:42:47.244 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has started: ['rpm', '-q', '--whatprovides', 'kernel-rt-uname-r']
      2024-08-29 09:42:47.279 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: no package provides kernel-rt-uname-r
      2024-08-29 09:42:47.281 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: Command ['rpm', '-q', '--whatprovides', 'kernel-rt-uname-r'] failed with exit code 1.
      2024-08-29 09:42:47.283 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has finished: ['rpm', '-q', '--whatprovides', 'kernel-rt-uname-r']
      2024-08-29 09:42:47.284 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has started: ['rpm', '-q', '--provides', u'kernel-3.10.0-1160.119.1.el7 (x86_64)']
      2024-08-29 09:42:47.391 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: Command ['rpm', '-q', '--provides', u'kernel-3.10.0-1160.119.1.el7 (x86_64)'] failed with exit code 1.
      2024-08-29 09:42:47.397 DEBUG    PID: 65153 leapp.workflow.FactsCollection.scan_source_kernel: External command has finished: ['rpm', '-q', '--provides', u'kernel-3.10.0-1160.119.1.el7 (x86_64)']
      2024-08-29 09:42:47.414 ERROR    PID: 58936 leapp.workflow.FactsCollection: Actor scan_source_kernel has crashed: Traceback (most recent call last):
      ~~~

              leapp-notifications leapp-notifications
              rhn-support-plawate Pranav Lawate
              leapp-notifications leapp-notifications
              RHEL Upgrades QE Team RHEL Upgrades QE Team
              Miriam Portman Miriam Portman
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: