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

Converting a C8S system to RHEL8 silently fails when yum is not installed

XMLWordPrintable

    • False
    • False
    • Hide

      None

      Show
      None
    • 2
    • Testable

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

      I'm converting one CentOS Stream 8 system to RHEL 8, and even after following [0] I just couldn't make convert2rhel work - both analyze and convert verb would just stop after a couple of phases without any error or message about what's wrong:

      # convert2rhel 
      convert2rhel command used:
      /usr/bin/convert2rhel
      
      [2024-06-24T09:48:42-0400] TASK - [Prepare: Show Red Hat software EULA] ******************************
      ...
      Continue with the system conversion? [y/n]: y
      
      
      
      [2024-06-24T09:48:43-0400] TASK - [Prepare: Gather system information] *******************************
      Running the 'rpm -Va' command which can take several minutes. It can be disabled by using the --no-rpm-va option.
      The 'rpm -Va' output has been stored in the /var/log/convert2rhel/rpm_va.log file.
      Name:                CentOS Stream
      OS version:          8.10
      Architecture:        x86_64
      Config filename:     centos-8-x86_64.cfg
      
      [2024-06-24T09:49:26-0400] TASK - [Prepare: Clear YUM/DNF version locks] *****************************
      Usage of YUM/DNF versionlock plugin not detected.
      
      [2024-06-24T09:49:26-0400] TASK - [Prepare: Clean yum cache metadata] ********************************
      Writing breadcrumbs to '/etc/migration-results'.
      Writing RHSM custom facts to '/etc/rhsm/facts/convert2rhel.facts'.
      No changes were made to the system.
      

      There's no information about what and/or why failed neither on screen nor in any of the log files. Only after rerunning the command with --debug it shows something actionable:

      [2024-06-24T09:53:08-0400] TASK - [Prepare: Clean yum cache metadata] ********************************
      [2024-06-24T09:53:08-0400] DEBUG - Calling command 'yum clean metadata --enablerepo=* --quiet'
      Writing breadcrumbs to '/etc/migration-results'.
      Writing RHSM custom facts to '/etc/rhsm/facts/convert2rhel.facts'.
      [2024-06-24T09:53:08-0400] DEBUG - Traceback (most recent call last):
        File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 141, in main_locked
          prepare_system()
        File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 363, in prepare_system
          pkgmanager.clean_yum_metadata()
        File "/usr/lib/python3.6/site-packages/convert2rhel/pkgmanager/__init__.py", line 100, in clean_yum_metadata
          ("yum", "clean", "metadata", "--enablerepo=*", "--quiet"), print_output=False
        File "/usr/lib/python3.6/site-packages/convert2rhel/utils/__init__.py", line 353, in run_subprocess
          bufsize=1,
        File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
          restore_signals, start_new_session)
        File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'yum': 'yum'
      
      No changes were made to the system.
      [2024-06-24T09:53:08-0400] DEBUG - /var/run/lock/convert2rhel.pid PID 43651 unlocked.
      

      The system in question doesn't have yum installed as I removed it quite a while ago (and use dnf). I understand that this is quite a niche scenario (since the yum package is protected even if it's installed alongside dnf), but It would be great if convert2rhel complained loudly about this, as yum appears to be crucial for the conversion to work.

      [0] https://access.redhat.com/articles/2360841

      Please provide the package NVR for which bug is seen:

      convert2rhel-2.0.0-1.el8.noarch

      How reproducible:

      always

      Steps to reproduce

      1.  rm /etc/yum/protected.d/yum.conf
      2.  dnf remove yum
      3.  convert2rhel

              mbocek@redhat.com Michal Bocek
              fsumsalrh Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: