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

Redhat.repo not being backed up when registered to Satellite

XMLWordPrintable

    • Testable

      When system is registered to Satellite providing CentOS and RHEL repos, the conversion fails during backup of centos-release package.

      In fact this is simmilar to offline conversion.

      Steps to reproduce on CentOS 7 vagrant:

      yum install subscription-manager -y
      
      # use the activation curl command available in https://gitlab.cee.redhat.com/oamg/convert2rhel/convert2rhel-secrets/-/merge_requests/26
      
      # OR using the old way with katello
      wget --no-check-certificate --output-document /usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm https://satellite.sat.engineering.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
      rpm -i /usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm
      
      # probably not needed since this will be downloaded during conversion. I did that for checking if the repos ale really provided
      curl https://raw.githubusercontent.com/oamg/convert2rhel/main/convert2rhel/data/7/x86_64/rhel-certs/69.pem -o /etc/pki/product-default/69.pem
      subscription-manager register --org=<our_org> --activationkey=<key_providing_centos_and_rhel_repos>
      
      # if you don't see rhel repo after running: subscription-manager repos (if you downloaded the certificate above)
      subscription-manager refresh
      
      subscription-manager repos --enable="Satellite_Engineering_CentOS_7_Updates_x86_64" --enable="Satellite_Engineering_CentOS_7_Base_x86_64"
      subscription-manager repos --disable="rhel-7-server-rpms"
      cd /etc/yum.repos.d/
      rm c2r_copr.repo Cent* rhel* -f
      
      convert2rhel analyze --debug -y
      

      Actual output (full log attached)

      ========== Error (Must fix before conversion) ==========
      (ERROR) REMOVE_SPECIAL_PACKAGES::UNEXPECTED_ERROR - Unhandled exception caught
           Description: Unhandled exception was caught: [Errno 2] No such file or directory: '/var/lib/convert2rhel/backup/ed2e326f3aefc335463ab68aa15a72c2'
          Please file a bug at https://issues.redhat.com/ to have this fixed or a specific error message added.
          Traceback: Traceback (most recent call last):
            File "/usr/lib/python2.7/site-packages/convert2rhel/actions/__init__.py", line 572, in run
              action.run()
            File "/usr/lib/python2.7/site-packages/convert2rhel/actions/pre_ponr_changes/handle_packages.py", line 120, in run
              backup_control.push(RestorablePackage(pkgs=pkghandler.get_pkg_nevras(all_pkgs), reposdir=backedup_reposdir))
            File "/usr/lib/python2.7/site-packages/convert2rhel/backup/__init__.py", line 72, in push
              restorable.enable()
            File "/usr/lib/python2.7/site-packages/convert2rhel/backup/packages.py", line 142, in enable
              if len(os.listdir(self.reposdir)) == 0 or not os.path.exists(self.reposdir):
          OSError: [Errno 2] No such file or directory: '/var/lib/convert2rhel/backup/ed2e326f3aefc335463ab68aa15a72c2'
      

      Acceptance criteria:

            rolivier@redhat.com Rodolfo Olivieri
            ahosek@redhat.com Adam Hosek
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: