Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-1272

Running pre-conversion analysis on a system with yum-plugin-local installed leads to broken rollback and unusable system

XMLWordPrintable

    • False
    • False
    • Hide

      None

      Show
      None
    • 2023-R4
    • Testable

      Similarly as in HMS-3128 but with different root cause, I've hit an issue when pre-conversion analysis reported inhibitors, but left the system in broken state without properly informing the user.

      Steps to reproduce

      1. Install minimal packageset of CentOS-7.9 on x86_64 system
      2. Update package using yum update
      3. Install yum-plugin-local package:
        yum install yum-plugin-local
      4. Reboot system
      5. Follow steps from https://access.redhat.com/documentation/en-us/red_hat_insights/2023/html/converting_from_an_rpm-based_linux_distribution_to_rhel_using_red_hat_insights/proc_preparing-for-a-rhel-conversion-using-insights_converting-from-a-linux-distribution-to-rhel-in-insights
      6. Run "Pre-conversion analysis for converting to RHEL" task

      The system becomes unusable as key packages such as centos-release are removed from the system and user is in situation as described in HMS-3128.

      # rpm -q centos-release
      package centos-release is not installed

      Key part from the logfile:

      Backing up centos-release-7-9.2009.1.el7.centos.x86_64.
      [2023-11-24T08:14:29+0000] DEBUG - Using repository files stored in /var/lib/convert2rhel/backup.
      [2023-11-24T08:14:29+0000] DEBUG - Downloading the centos-release-7-9.2009.1.el7.centos.x86_64 package.
      [2023-11-24T08:14:29+0000] DEBUG - Calling command 'yumdownloader -v --destdir=/var/lib/convert2rhel/backup --setopt=reposdir=/var/lib/convert2rhel/backup centos-release-7-9.2009.1.el7.centos.x86_64'
      WARNING - Couldn't find the name of the downloaded rpm in the output of yumdownloader.
      Command:
      ['yumdownloader', '-v', '--destdir=/var/lib/convert2rhel/backup', '--setopt=reposdir=/var/lib/convert2rhel/backup', u'centos-release-7-9.2009.1.el7.centos.x86_64']
      Output:
      Loading "fastestmirror" plugin
      Loading "local" plugin
      Loading "product-id" plugin
      Loading "subscription-manager" plugin
      Updating Subscription Management repositories.
      Config time: 0.617
      Loading mirror speeds from cached hostfile
       * base: centos.po.opole.pl
       * extras: ftp.sh.cvut.cz
       * updates: ftp.sh.cvut.cz
      repo time: 0.045
      Setting up Package Sacks
      pkgsack time: 0.008
      rpmdb time: 0.000
      centos-release-7-9.2009.1.el7.centos.x86_64.rpm                                                                                |  27 kB  00:00:00     
      == Rebuilding _local repo. with 1 new packages ==
      Spawning worker 0 with 1 pkgs
      Spawning worker 1 with 0 pkgs
      Spawning worker 2 with 0 pkgs
      Spawning worker 3 with 0 pkgs
      Workers Finished
      Saving Primary metadata
      Saving file lists metadata
      Saving other metadata
      Generating sqlite DBs
      Sqlite DBs complete
      == Done rebuild of _local repo. ==Removing package: centos-release-7-9.2009.1.el7.centos.x86_64
      
      Removing package: centos-release-7-9.2009.1.el7.centos.x86_64
      [2023-11-24T08:14:31+0000] DEBUG - Calling command 'rpm -e --nodeps centos-release-7-9.2009.1.el7.centos.x86_64'
      [2023-11-24T08:14:31+0000] DEBUG - Successfully removed 1 packages
      The following packages were removed: centos-release-7-9.2009.1.el7.centos.x86_64

      This is caused by the parsing of the yumdownloader output implemented here: https://github.com/oamg/convert2rhel/blob/45cc02671931fcf279dd63eda02e8b310a07cc25/convert2rhel/utils.py#L778 and more specifically due to https://github.com/oamg/convert2rhel/blob/45cc02671931fcf279dd63eda02e8b310a07cc25/convert2rhel/utils.py#L773 which causes that only the last line of the yumdownloader output is considered which in case of local plugin and yumdownloader being called with -v causes that there's additional ouput. (Thanks to ddiblik@redhat.com for help with debugging and finding the problematic code.)

      When checking the /var/lib/convert2rhel/backup the downloaded RPMs are available there:

      # ls /var/lib/convert2rhel/backup
      centos-logos-70.0.6-3.el7.centos.noarch.rpm  centos-release-7-9.2009.1.el7.centos.x86_64.rpm  os-release  system-release  yum

       

      Note: this issue was discovered when we were attempting to perform conversion with largest possible packageset installed, this issues is a minimal reproducer of a issue that was discovered during the attempt of converting a system with as many packages installed as possible.

        1. success.png
          success.png
          31 kB
        2. convert2rhel.log
          63 kB

              mbocek@redhat.com Michal Bocek
              pholica@redhat.com Pavel Holica
              Daniel Diblik Daniel Diblik
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: