RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2127448 - Convert2RHEL fails when subscription-manager-rhsm-certificates package is installed
Summary: Convert2RHEL fails when subscription-manager-rhsm-certificates package is ins...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: convert2rhel
Version: 8.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Bocek
QA Contact: Upgrades and Supportability
Miriam Portman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-16 11:35 UTC by paygupta
Modified: 2023-01-03 13:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-03 13:29:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELC-744 0 None None None 2022-09-16 11:39:05 UTC
Red Hat Issue Tracker RHELPLAN-134171 0 None None None 2022-09-16 11:39:07 UTC
Red Hat Knowledge Base (Solution) 6977976 0 None None None 2022-10-06 11:14:00 UTC
Red Hat Product Errata RHEA-2023:0015 0 None None None 2023-01-03 13:29:48 UTC

Description paygupta 2022-09-16 11:35:10 UTC
Description of problem:
Convert2rhel fails with 'Errors during downloading metadata for repository 'convert2rhel-for-rhel-8-rpms' error when subscription-manager package is installed on the system. 

Version-Release number of selected component (if applicable):
convert2rhel-1.0-1.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install CentOS 8.5
2. Install subscription-manager package from CentOS Baseos repository. 
3. Install convert2rhel package by runnig below commands as per documentation:

# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
# curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
# curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/8/convert2rhel.repo
# yum -y install convert2rhel

4. Run convert2hel command :

# convert2rhel --username <username>

Actual results:
----------------------

TASK - [Convert: Subscription Manager - Replace] **************************
Unregistering the system.
WARNING - System unregistration result:
This system is currently not registered.

Removing installed subscription-manager/katello-ca-consumer packages.
Upon continuing, we will uninstall the following subscription-manager/katello-ca-consumer packages:

Package                                                      Vendor/Packager  Repository
-------                                                      ---------------  ----------
dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64         CentOS           @baseos
python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64       CentOS           @baseos
subscription-manager-1.28.21-3.el8.x86_64                    CentOS           @baseos
subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64  CentOS           @baseos


Continue with the system conversion? [y/n]: y


Backing up dnf-plugin-subscription-manager.
Successfully downloaded the dnf-plugin-subscription-manager package.
Backing up python3-subscription-manager-rhsm.
Successfully downloaded the python3-subscription-manager-rhsm package.
Backing up subscription-manager.
Successfully downloaded the subscription-manager package.
Backing up subscription-manager-rhsm-certificates.
Successfully downloaded the subscription-manager-rhsm-certificates package.
Removing package: dnf-plugin-subscription-manager
Removing package: python3-subscription-manager-rhsm
Removing package: subscription-manager
Removing package: subscription-manager-rhsm-certificates
Checking for subscription-manager RPMs.
Installing subscription-manager RPMs.
CentOS Linux 8 - AppStream                      954 kB/s | 8.4 MB     00:09    
CentOS Linux 8 - BaseOS                         942 kB/s | 4.6 MB     00:04    
CentOS Linux 8 - Extras                          16 kB/s |  10 kB     00:00    
Convert2RHEL for OS 8                           0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'convert2rhel-for-rhel-8-rpms':
  - Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
Error: Failed to download metadata for repo 'convert2rhel-for-rhel-8-rpms': Cannot download repomd.xml: Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
CRITICAL - Failed to install subscription-manager packages. See the above yum output for details.
WARNING - Abnormal exit! Performing rollback ...


Expected results:
conversion should complete without any error. 

Additional info:
- If subscription-manager package is removed and https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem is downloaded again to /etc/rhsm/ca/ then conversion completes successfully. 
- Or if the convert2rhel repo is disabled before running convert2rhel command then the conversion completes without any issue. 
- Issue is not observed with old convert2rhel-0.26-1.el8.noarch package.

Comment 1 jcastran 2022-09-27 12:53:29 UTC
Confirming this does occur. It's not common as it requires centos subscription-manager-rhsm-certificates to be installed and to NOT use the option "keep-rhsm"

When run normally with no options, convert2rhel will remove the existing subscription-manager packages, which deletes the /etc/rhsm/ca/redhat-uep.pem. When convert2rhel tries to install subscription-manager, it checks all the repos and can't access convert2rhel since the CA is gone. 

*If no subscription-manager packages are installed, then convert2rhel won't touch the manually placed /etc/rhsm/ca/redhat-uep.pem.


Options:
- disable ssl verification for convert2rhel
- apply "skip_if_unavailable=True"
- place the redhat-uep.pem somewhere else, or rename it to anything else so that the removal of subscription-manager-rhsm-certificates does not cause this CA to be removed

Comment 2 Eric Gustavsson 2022-10-06 12:32:15 UTC
Thanks John

I'm working with @prjagtap to create a KCS, then I'll update the known issues section in product docs

Comment 3 Pradeep Jagtap 2022-10-08 07:24:14 UTC
Thanks Eric.
KCS is created https://access.redhat.com/solutions/6977976 which includes the workaround.

Comment 5 jcastran 2022-11-14 16:10:56 UTC
Clarifying these reproducer steps:

1. Install 3rd party subscription-manager-rhsm-certificates
2. convert2rhel will backup this package, then rip it out.
[09/06/2022 09:27:09] FILE - Calling command 'rpm -e --nodeps subscription-manager-rhsm-certificates'

RHEL 8 EXAMPLE
[root@r8 ~]$ ll /etc/rhsm/ca/redhat-uep.pem
-rw-r--r--. 1 root root 7411 Apr 13  2022 /etc/rhsm/ca/redhat-uep.pem
[root@r8 ~]$ rpm -e --nodeps subscription-manager-rhsm-certificates
[root@r8 ~]$ ll /etc/rhsm/ca/redhat-uep.pem
ls: cannot access '/etc/rhsm/ca/redhat-uep.pem': No such file or directory

3. Because the certificate has been removed, skip_if_unavailable=False is the default, and convert2rhel is enabled the repository fails and yum can't continue.

$ egrep 'ssl|enabled' etc/yum.repos.d/convert2rhel.repo
  enabled=1
  sslcacert=/etc/rhsm/ca/redhat-uep.pem

$ grep skip etc/yum.conf
  skip_if_unavailable=False

We see the below section where we call yum to install the local rpms and since it's yum, all repos must work or we fail. 

~~~
[09/06/2022 09:27:09] FILE - Calling command 'yum install -y --setopt=module_platform_id=platform:el8 /usr/share/convert2rhel/subscription-manager/subscription-manager-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/subscription-manager-rhsm-certificates-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/python3-subscription-manager-rhsm-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/dnf-plugin-subscription-ma
nager-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/python3-syspurpose-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-ma
nager/python3-cloud-what-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/json-c-0.13.1-3.el8.x86_64.rpm'

Errors during downloading metadata for repository 'convert2rhel-for-rhel-8-rpms':
  - Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
Error: Failed to download metadata for repo 'convert2rhel-for-rhel-8-rpms': Cannot download repomd.xml: Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
~~~





=======================================
Logs with context inline (if it helps)
Commentary marked with > > > 
=======================================

Package                                                      Vendor/Packager  Repository
-------                                                      ---------------  ----------
dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64         CentOS           @baseos
python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64       CentOS           @baseos
subscription-manager-1.28.21-3.el8.x86_64                    CentOS           @baseos
subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64  CentOS           @baseos       ###> > > We have Centos sub-man-rhsm-certs


> > > We backup the centos packages without issue.

Backing up dnf-plugin-subscription-manager.
[09/06/2022 09:27:04] FILE - Using repository files stored in /usr/share/convert2rhel/repos/centos-8.5.
[09/06/2022 09:27:04] FILE - Downloading the dnf-plugin-subscription-manager package.
[09/06/2022 09:27:04] FILE - Calling command 'yumdownloader -v --destdir=/var/lib/convert2rhel/backup --setopt=reposdir=/usr/share/convert2rhel/repos/centos-8.5 --setopt=module_platform_id=platform:el8 dnf-plugin-subscription-manager'
Successfully downloaded the dnf-plugin-subscription-manager package.
[09/06/2022 09:27:05] FILE - Path of the downloaded package: /var/lib/convert2rhel/backup/dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64.rpm
Backing up python3-subscription-manager-rhsm.
[09/06/2022 09:27:05] FILE - Using repository files stored in /usr/share/convert2rhel/repos/centos-8.5.
[09/06/2022 09:27:05] FILE - Downloading the python3-subscription-manager-rhsm package.
[09/06/2022 09:27:05] FILE - Calling command 'yumdownloader -v --destdir=/var/lib/convert2rhel/backup --setopt=reposdir=/usr/share/convert2rhel/repos/centos-8.5 --setopt=module_platform_id=platform:el8 python3-subscription-manager-rhsm'
Successfully downloaded the python3-subscription-manager-rhsm package.
[09/06/2022 09:27:06] FILE - Path of the downloaded package: /var/lib/convert2rhel/backup/python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64.rpm
Backing up subscription-manager.
[09/06/2022 09:27:06] FILE - Using repository files stored in /usr/share/convert2rhel/repos/centos-8.5.
[09/06/2022 09:27:06] FILE - Downloading the subscription-manager package.
[09/06/2022 09:27:06] FILE - Calling command 'yumdownloader -v --destdir=/var/lib/convert2rhel/backup --setopt=reposdir=/usr/share/convert2rhel/repos/centos-8.5 --setopt=module_platform_id=platform:el8 subscription-manager'
Successfully downloaded the subscription-manager package.
[09/06/2022 09:27:07] FILE - Path of the downloaded package: /var/lib/convert2rhel/backup/subscription-manager-1.28.21-3.el8.x86_64.rpm
Backing up subscription-manager-rhsm-certificates.
[09/06/2022 09:27:07] FILE - Using repository files stored in /usr/share/convert2rhel/repos/centos-8.5.
[09/06/2022 09:27:07] FILE - Downloading the subscription-manager-rhsm-certificates package.
[09/06/2022 09:27:07] FILE - Calling command 'yumdownloader -v --destdir=/var/lib/convert2rhel/backup --setopt=reposdir=/usr/share/convert2rhel/repos/centos-8.5 --setopt=module_platform_id=platform:el8 subscription-manager-rhsm-certificates'
Successfully downloaded the subscription-manager-rhsm-certificates package.
[09/06/2022 09:27:08] FILE - Path of the downloaded package: /var/lib/convert2rhel/backup/subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64.rpm

> > > Next we remove the packages. This is where the certificate is deleted. 

Removing package: dnf-plugin-subscription-manager
[09/06/2022 09:27:08] FILE - Calling command 'rpm -e --nodeps dnf-plugin-subscription-manager'
Removing package: python3-subscription-manager-rhsm
[09/06/2022 09:27:09] FILE - Calling command 'rpm -e --nodeps python3-subscription-manager-rhsm'
Removing package: subscription-manager
[09/06/2022 09:27:09] FILE - Calling command 'rpm -e --nodeps subscription-manager'
Removing package: subscription-manager-rhsm-certificates
[09/06/2022 09:27:09] FILE - Calling command 'rpm -e --nodeps subscription-manager-rhsm-certificates'


> > > CUT IN THE LOGS FOR AN EXAMPLE
> > > [root@r8 ~]$ ll /etc/rhsm/ca/redhat-uep.pem
> > > -rw-r--r--. 1 root root 7411 Apr 13  2022 /etc/rhsm/ca/redhat-uep.pem
> > > [root@r8 ~]$ rpm -e --nodeps subscription-manager-rhsm-certificates
> > > [root@r8 ~]$ ll /etc/rhsm/ca/redhat-uep.pem
> > > ls: cannot access '/etc/rhsm/ca/redhat-uep.pem': No such file or directory

> > > Back to the logs, we call yum to install content. Since convert2rhel.repo is enabled, and skip_if_unavailable=False is our default, it fails bc (sslcacert=/etc/rhsm/ca/redhat-uep.pem)  missing. 

Checking for subscription-manager RPMs.
Installing subscription-manager RPMs.
[09/06/2022 09:27:09] FILE - Calling command 'yum install -y --setopt=module_platform_id=platform:el8 /usr/share/convert2rhel/subscription-manager/subscription-manager-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/subscription-manager-rhsm-certificates-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/python3-subscription-manager-rhsm-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/dnf-plugin-subscription-ma
nager-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/python3-syspurpose-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-ma
nager/python3-cloud-what-1.28.29-3.el8.x86_64.rpm /usr/share/convert2rhel/subscription-manager/json-c-0.13.1-3.el8.x86_64.rpm'
CentOS Linux 8 - AppStream                       30 MB/s | 8.4 MB     00:00
CentOS Linux 8 - BaseOS                          23 MB/s | 4.6 MB     00:00
CentOS Linux 8 - Extras                         108 kB/s |  10 kB     00:00
Convert2RHEL for OS 8                           0.0  B/s |   0  B     00:00
Errors during downloading metadata for repository 'convert2rhel-for-rhel-8-rpms':
  - Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
Error: Failed to download metadata for repo 'convert2rhel-for-rhel-8-rpms': Cannot download repomd.xml: Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
CRITICAL - Failed to install subscription-manager packages. See the above yum output for details.
[09/06/2022 09:27:10] FILE - Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 104, in main
    pre_ponr_conversion()
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 198, in pre_ponr_conversion
    subscription.replace_subscription_manager()
  File "/usr/lib/python3.6/site-packages/convert2rhel/subscription.py", line 632, in replace_subscription_manager
    install_rhel_subscription_manager()
  File "/usr/lib/python3.6/site-packages/convert2rhel/subscription.py", line 696, in install_rhel_subscription_manager
    loggerinst.critical("Failed to install subscription-manager packages. See the above yum output for details.")
  File "/usr/lib/python3.6/site-packages/convert2rhel/logger.py", line 184, in _critical
    sys.exit(msg)
SystemExit: Failed to install subscription-manager packages. See the above yum output for details.

WARNING - Abnormal exit! Performing rollback ...

[09/06/2022 09:27:10] TASK - [Rollback: RHSM-related actions] ***********************************
Unregistering the system.
[09/06/2022 09:27:10] FILE - Calling command 'rpm --quiet -q subscription-manager'
The subscription-manager package is not installed.

[09/06/2022 09:27:11] TASK - [Rollback: Removing installed packages] ****************************
No package to remove

> > > Here we reinstall the sub-man-rhsm-cert package without issue

[09/06/2022 09:27:11] TASK - [Rollback: Installing removed packages] ****************************
Installing packages:
        /var/lib/convert2rhel/backup/centos-gpg-keys-8-3.el8.noarch.rpm
        /var/lib/convert2rhel/backup/dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64.rpm
        /var/lib/convert2rhel/backup/python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64.rpm
        /var/lib/convert2rhel/backup/subscription-manager-1.28.21-3.el8.x86_64.rpm
        /var/lib/convert2rhel/backup/subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64.rpm
[09/06/2022 09:27:11] FILE - Calling command 'rpm -i --replacepkgs /var/lib/convert2rhel/backup/centos-gpg-keys-8-3.el8.noarch.rpm /var/lib/convert2rhel/backup/dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64.rpm /var/lib/convert2rhel/backup/python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64.rpm /var/lib/convert2rhel/backup/subscription-manager-1.28.21-3.el8.x86_64.rpm /var/lib/convert2rhel/backup/subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64.rpm'

Comment 8 Daniel Diblik 2022-12-08 14:30:20 UTC
This bug was tested as a part of automated regression testing on version *convert2rhel-1.0-1.el8.noarch.rpm* and *convert2rhel-1.1-1.el8.noarch.rpm* with their respective results provided below.
This comment has log references to CentOS-8-latest, other targets with their respective results and log files can be found in the regression verification issue https://issues.redhat.com/browse/RHELC-794

====================*convert2rhel-1.0-1.el8.noarch.rpm*====================
[logfile link: http://artifacts.osci.redhat.com/testing-farm/29dce393-4b7e-4b6c-95f2-41197e0100a5/work-sub_man_rollbackh3y3tb27/plans/tier0/sub_man_rollback/execute/data/tests/integration/tier0/sub-man-rollback/sub_man_rollback/output.txt]


[12/07/2022 06:59:55] TASK - [Convert: Subscription Manager - Replace] **************************[0m
Unregistering the system.
[12/07/2022 06:59:55] DEBUG - Calling command 'rpm --quiet -q subscription-manager'
[12/07/2022 06:59:55] DEBUG - Calling command 'subscription-manager unregister'
[93mWARNING - System unregistration result:
This system is currently not registered.
[0m
Removing installed subscription-manager/katello-ca-consumer packages.
Upon continuing, we will uninstall the following subscription-manager/katello-ca-consumer packages:

Package                                                      Vendor/Packager  Repository
-------                                                      ---------------  ----------
dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64         CentOS           @baseos
python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64       CentOS           @baseos
subscription-manager-1.28.21-3.el8.x86_64                    CentOS           @baseos
subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64  CentOS           @baseos
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<
Errors during downloading metadata for repository 'convert2rhel-for-rhel-8-rpms':
  - Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
Error: Failed to download metadata for repo 'convert2rhel-for-rhel-8-rpms': Cannot download repomd.xml: Curl error (77): Problem with the SSL CA cert (path? access rights?) for https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/repodata/repomd.xml [error setting certificate verify locations:
  CAfile: /etc/rhsm/ca/redhat-uep.pem
  CApath: none]
[91mCRITICAL - Failed to install subscription-manager packages. See the above yum output for details.[0m
[12/07/2022 07:00:16] DEBUG - Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 104, in main
    pre_ponr_conversion()
  File "/usr/lib/python3.6/site-packages/convert2rhel/main.py", line 198, in pre_ponr_conversion
    subscription.replace_subscription_manager()
  File "/usr/lib/python3.6/site-packages/convert2rhel/subscription.py", line 632, in replace_subscription_manager
    install_rhel_subscription_manager()
  File "/usr/lib/python3.6/site-packages/convert2rhel/subscription.py", line 696, in install_rhel_subscription_manager
    loggerinst.critical("Failed to install subscription-manager packages. See the above yum output for details.")
  File "/usr/lib/python3.6/site-packages/convert2rhel/logger.py", line 184, in _critical
    sys.exit(msg)
SystemExit: Failed to install subscription-manager packages. See the above yum output for details.

-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<

FAILED

=================================== FAILURES ===================================
____________________________ test_sub_man_rollback _____________________________

-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<


convert2rhel = <function convert2rhel.<locals>.factory at 0x7fe1c25d8b70>
shell = <function shell.<locals>.factory at 0x7fe1c25d8a60>

    @pytest.mark.sub_man_rollback
    def test_sub_man_rollback(convert2rhel, shell):
        """
        Verify that convert2rhel removes and backs up the original vendor subscription-manager packages, including
        python3-syspurpose and python3-cloud-what which are also built out of the subscription-manager SRPM.
    
        Not removing and backing up the python3-syspurpose and python3-cloud-what packages on CentOS Linux 8.5 was causing
        a rollback failure when an older version of these two packages was installed.
    
        The rollback failure caused the following issues during the subsequent second run of convert2rhel:
        1. when the rollback happened before removing the centos-linux-release package, the removed
          subscription-manager-rhsm-certificates was not re-installed back during the rollback leading to a missing
          /etc/rhsm/ca/redhat-uep.pem file which is necessary for accessing the official convert2rhel repo on CDN
          (https://issues.redhat.com/browse/RHELC-744)
        2. when the rollback happened before removing the centos-linux-release package, this package was not re-installed
          back during the rollback and that lead to the $releasever variable being undefined, ultimately causing a traceback
          when using the DNF python API (https://issues.redhat.com/browse/RHELC-762)
        """
        assert shell("rpm -qi subscription-manager").returncode == 0
        # The following repository requires the redhat-uep.pem certificate. convert2rhel will try accessing the repo and
        # by running convert2rhel twice makes sure that the rollback of the first run correctly reinstalled the certificate
        # when installing subscription-manager-rhsm-certificates.
        assert (
            shell(
                "curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/8/convert2rhel.repo"
            ).returncode
            == 0
        )
        assert os.path.exists("/etc/yum.repos.d/convert2rhel.repo") is True
    
        for run in range(2):
            with convert2rhel(
                ("-y --no-rpm-va --serverurl {} --username {} --password {} --pool {} --debug").format(
                    env.str("RHSM_SERVER_URL"),
                    env.str("RHSM_USERNAME"),
                    env.str("RHSM_PASSWORD"),
                    env.str("RHSM_POOL"),
                )
            ) as c2r:
>               assert c2r.expect("Validate the dnf transaction") == 0

test_sub_man_rollback.py:47: 
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<

                msg = str(err) + '\n' + msg
>           raise EOF(msg)
E           pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
E           <pexpect.pty_spawn.spawn object at 0x7fe1c25ec4e0>
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<

E           delayafterterminate: 0.1
E           searcher: searcher_re:
E               0: re.compile("Validate the dnf transaction")

/usr/lib/python3.6/site-packages/pexpect/expect.py:49: EOF
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<

=========================== short test summary info ============================
FAILED test_sub_man_rollback.py::test_sub_man_rollback - pexpect.exceptions.E...
======================== 1 failed, 2 warnings in 50.86s ========================






====================*convert2rhel-1.1-1.el8.noarch.rpm*====================
[logfile link: http://artifacts.osci.redhat.com/testing-farm/91439867-64c9-4601-b9c3-ef3a89dbfb6d/work-sub_man_rollback1224rrcq/plans/tier0/sub_man_rollback/execute/data/tests/integration/tier0/sub-man-rollback/sub_man_rollback/output.txt]


[12/07/2022 06:58:49] TASK - [Convert: Subscription Manager - Replace] **************************
Unregistering the system.
[12/07/2022 06:58:49] DEBUG - Calling command 'rpm --quiet -q subscription-manager'
[12/07/2022 06:58:49] DEBUG - Calling command 'subscription-manager unregister'
WARNING - System unregistration result:
This system is currently not registered.

Removing installed subscription-manager/katello-ca-consumer packages.
Upon continuing, we will uninstall the following subscription-manager/katello-ca-consumer packages:

Package                                                      Vendor/Packager  Repository
-------                                                      ---------------  ----------
dnf-plugin-subscription-manager-1.28.21-3.el8.x86_64         CentOS           @baseos
python3-subscription-manager-rhsm-1.28.21-3.el8.x86_64       CentOS           @baseos
subscription-manager-1.28.21-3.el8.x86_64                    CentOS           @baseos
subscription-manager-rhsm-certificates-1.28.21-3.el8.x86_64  CentOS           @baseos
python3-syspurpose-1.28.21-3.el8.x86_64                      CentOS           @baseos
python3-cloud-what-1.28.21-3.el8.x86_64                      CentOS           @baseos

-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<
     

Complete!

Packages installed:
/usr/share/convert2rhel/subscription-manager/dnf-plugin-subscription-manager-1.28.32-1.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/python3-subscription-manager-rhsm-1.28.32-1.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/subscription-manager-1.28.32-1.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/python3-cloud-what-1.28.32-1.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/json-c-0.13.1-3.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/subscription-manager-rhsm-certificates-1.28.32-1.el8.x86_64.rpm
/usr/share/convert2rhel/subscription-manager/python3-syspurpose-1.28.32-1.el8.x86_64.rpm
[12/07/2022 06:59:03] DEBUG - Skipping tracking previously installed package: json-c
[12/07/2022 06:59:03] DEBUG - Tracking installed packages: ['dnf-plugin-subscription-manager', 'python3-subscription-manager-rhsm', 'subscription-manager', 'python3-cloud-what', 'subscription-manager-rhsm-certificates', 'python3-syspurpose']

[12/07/2022 06:59:03] TASK - [Convert: Subscription Manager - Verify installation] **************
subscription-manager installed correctly.
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<

PASSED

================== 1 passed, 2 warnings in 205.73s (0:03:25) ===================

Comment 10 errata-xmlrpc 2023-01-03 13:29:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (convert2rhel bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:0015


Note You need to log in before you can comment on or make changes to this bug.