Bug 1510024

Summary: RHEL-ALT 7.4 subscription manager is not able to list releases on Power-9
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Fedor <jfedor>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.4-AltCC: dtodorov, jbastian, jincutto, jreznik, jsefler, khowell, liliu, lkocman, salmy, sherold, vanhoof, wchadwic
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.10-1 Doc Type: Bug Fix
Doc Text:
Cause: subscription-manager did not handle the Red Hat Enterprise Linux for Power 9 product tags correctly. Consequence: subscription-manager was not able to list releases on Power 9 Fix: subscription-manager was updated to handle the Red Hat Enterprise Linux for Power 9 product tags correctly. Result: subscription-manager is able to list releases on Power 9
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:52:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Fedor 2017-11-06 14:51:25 UTC
Description of problem:
Subscription manager is not able to list releases. 
# subscription-manager release --list
No release versions available, please check subscriptions.

I think that recent cdn path change could cause this issue. 


Please check https://url.corp.redhat.com/a63a88b for additional details.

Version-Release number of selected component (if applicable):

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.19.23-1.el7_4
python-rhsm: 1.19.10-1.el7_4


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 John Sefler 2017-11-06 19:20:38 UTC
I can also reproduce this situation...

[root@ibm-p8-03-lp5 ~]# subscription-manager list --installed

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for Power 9
Product ID:     420
Version:        7.4
Arch:           ppc64le
Status:         Subscribed
Status Details: 
Starts:         09/20/2017
Ends:           09/19/2018

[root@ibm-p8-03-lp5 ~]# yum repolist --disablerepo=beaker*
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id                                     repo name                                                 status
rhel-7-for-power-9-extras-beta-rpms/ppc64le Red Hat Enterprise Linux 7 for POWER9 Extras Beta (RPMs)     71
rhel-7-for-power-9-rpms/7Server/ppc64le     Red Hat Enterprise Linux 7 for POWER9 (RPMs)              3,643
repolist: 3,714

[root@ibm-p8-03-lp5 ~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-for-power-9-extras-beta-rpms
Repo Name: Red Hat Enterprise Linux 7 for POWER9 Extras Beta (RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel/power-9/7/$basearch/extras/os
Enabled:   1

Repo ID:   rhel-7-for-power-9-rpms
Repo Name: Red Hat Enterprise Linux 7 for POWER9 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel-alt/server/7/$releasever/power9/$basearch/os
Enabled:   1

[root@ibm-p8-03-lp5 ~]# curl --stderr /dev/null --insecure --tlsv1 --cert /etc/pki/entitlement/1073747810485510683.pem --key /etc/pki/entitlement/1073747810485510683-key.pem https://cdn.redhat.com/content/dist/rhel-alt/server/7/listing
7.4
7Server

[root@ibm-p8-03-lp5 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

BANG!   Expected the release --list to show the contents of the /content/dist/rhel-alt/server/7/listing file

Comment 3 John Sefler 2017-11-06 19:56:32 UTC
Additional Info....

[root@ibm-p8-03-lp5 ~]# rct cat-cert /etc/pki/entitlement/1073747810485510683.pem | grep rhel-7-for-power-9-rpms -A8
	Label: rhel-7-for-power-9-rpms
	Vendor: Red Hat
	URL: /content/dist/rhel-alt/server/7/$releasever/power9/$basearch/os
	GPG: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
	Enabled: True
	Expires: 86400
	Required Tags: rhel-alt-7-power9     <====== LOOKS GOOD
	Arches: ppc64le

[root@ibm-p8-03-lp5 ~]# rct cat-cert /etc/pki/product-default/420.pem | grep Product: -A5
Product:
	ID: 420
	Name: Red Hat Enterprise Linux for Power 9
	Version: 7.4
	Arch: ppc64le
	Tags: rhel-alt-7,rhel-alt-7-power9   <====== LOOK HERE
              ^^^^^^^^^^

I suspect that subscription-manager does not consider product 420 to be a "rhel" product certificate because the "rhel-alt-7" tag does not match "rhel-\d+" as was the general case for rhel-5, rhel-6, and rhel-7 product certs.

Investigate solution for older bug 1108257 which presented a similar issue for product 71 whose tags "rhel-5-workstation,rhel-5-client-workstation" caused the same problem.

Comment 4 Whitney Chadwick 2017-11-08 17:59:31 UTC
Adding comments from Jenny Severance:


I just tried again on Song's machine and the issue is still there.  The listing file exists with the release versions but as John already pointed out the issue is with the tagging (see last comment).  This is not a subscription manager bug per se ... they can not fix it.  It is a release engineering bug
please ping the release engineer to fix it.

Comment 5 Jaroslav Fedor 2017-11-08 19:54:07 UTC
If the issue is with product certificates, I can tell that fixing this require rebuild of redhat-release-server pkg and respin of RC compose. I would not do it 10 hours before GA! This feature allows customers to switch between version releases. Since there is only one release (7.4), we agreed to tag is as RHEL-ALT-7.5 blocker bug. 

also moving to releng component

Thanks 
Jaroslav

Comment 7 John Sefler 2017-11-11 04:33:10 UTC
(In reply to Jaroslav Fedor from comment #5)
> This feature allows customers to switch between version releases.
> Since there is only one release (7.4), we agreed to tag is as RHEL-ALT-7.5
> blocker bug. 

Although this is true - there is only one rhel-alt release (7.4) today, waiting for a fix until rhel-alt-7.5 means that the customer CANNOT run "subscription-manager release --set=7.4" prior to the GA release of 7.5 and will be forced to yum update to 7.5 to get a bug fix so they they can run "subscription-manager release --set=7.4" and then carefully yum downgrade back to 7.4.  That will be a messy process.  For this reason, please reconsider delivering a fix via rhel-alt-7.4.z.

Remember... the purpose for setting a system to a particular dot release is to help customers who must maintain their system content to a fixed minor release for a time period greater than Red Hat's minor release cadence.

My vote is to fix the tags on both the rhel-alt-7.4 product certs 420 and 419 as follows:

http://git.app.eng.bos.redhat.com/git/rcm/rcm-metadata.git/tree/product_ids/rhel-alt-7.4/Server-Server-ppc64le-95b1c9ce651d-420-ext.txt
1.3.6.1.4.1.2312.9.1.420.4=ASN1:UTF8:rhel-alt-7,rhel-alt-7-power9
                     CURRENT TAGS:   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     PROPOSED TAGS:  rhel-alt-7,rhel-alt-7-power9,rhel-7

http://git.app.eng.bos.redhat.com/git/rcm/rcm-metadata.git/tree/product_ids/rhel-alt-7.4/Server-Server-aarch64-b5c08f5d64fa-419-ext.txt
1.3.6.1.4.1.2312.9.1.419.4=ASN1:UTF8:rhel-alt-7,rhel-alt-7-armv8-a
                     CURRENT TAGS:   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     PROPOSED TAGS:  rhel-alt-7,rhel-alt-7-armv8-a,rhel-7

Notice that I simply appended a "rhel-7" tag (or you could prepend it).  This will satisfy subscription-manager's algorithm for identification of a RHEL system.

I'm also changing the component to redhat-release since this is the component package that actually provides the default product cert.

[root@ibm-p8-03-lp9 ~]# rpm -q --whatprovides /etc/pki/product-default/420.pem
redhat-release-server-7.4-23.el7a.ppc64le

Comment 15 John Sefler 2018-02-13 17:44:44 UTC
Since the decision in comment 13 was made to fix this bug in subscription-manager component, I'll verify this bug with the fixed version of subscription-manager-1.20.10-1.el7.ppc64le and the rhel-alt-7.5 product cert Server-Server-ppc64le-b4df0af329fe-420.pem manually installed on a pre-GA RHEL-ALT system....

[root@ibm-p9z-05 ~]# rpm -q subscription-manager
subscription-manager-1.20.10-1.el7.ppc64le

[root@ibm-p9z-05 ~]# rct cat-cert /etc/pki/product/Server-Server-ppc64le-b4df0af329fe-420.pem | grep Product: -A5
Product:
	ID: 420
	Name: Red Hat Enterprise Linux for Power 9
	Version: 7.5
	Arch: ppc64le
	Tags: rhel-alt-7,rhel-alt-7-power9

[root@ibm-p9z-05 ~]# subscription-manager register --serverurl=subscription.rhsm.stage.redhat.com:443/subscription --baseurl=https://cdn.redhat.com --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_auto_testuser1
Password: 
The system has been registered with ID: fd64b235-96d5-487a-a053-eeac44270e05
The registered system name is: ibm-p9z-05.pnr.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for Power 9
Status:       Subscribed

[root@ibm-p9z-05 ~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-for-power-9-rpms
Repo Name: Red Hat Enterprise Linux 7 for POWER9 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel-alt/server/7/$releasever/power9/$basearch/os
Enabled:   1

[root@ibm-p9z-05 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
7.4
7Server


VERIFIED!  At this time (pre-GA of RHEL-ALT-7.5), the list of available $releasever values [7.4,7Server] is correct.  Post-GA of RHEL-ALT-7.5, we should expect [7.4,7.5,7Server].

Comment 18 errata-xmlrpc 2018-04-10 09:52:05 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, 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/RHBA-2018:0681