Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2028969

Summary: installed product status is not accurate
Product: Red Hat Enterprise Linux 9 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 9.0CC: jhnidek, redakkan
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.23-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:58:31 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 John Sefler 2021-12-03 20:30:07 UTC
Description of problem:
After subscribing to a subscription that provides a currently installed product, the status of the installed product should change from "Not Subscribe" to "Subscribed".  This has been a long time expectation which recently started failing after the following pull request was merged...

  https://github.com/candlepin/subscription-manager/pull/2860/commits


Version-Release number of selected component (if applicable):
subscription-manager-1.29.21-1.git.32.0e44220.el9

How reproducible:


Steps to Reproduce:
Using a continuous integration build of subscription-manager-1.29.21-1.git.32.0e44220 an a local candlepin deployed with TESTDATA...

[root@rhsm-auto9-client1 ~]# subscription-manager register --username=testuser1 --org=admin
Registering to: rhsm-auto9-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 6e253f98-7ef0-465a-a083-1bb57e4861e6
The registered system name is: rhsm-auto9-client1.usersys.redhat.com

[root@rhsm-auto9-client1 ~]# subscription-manager list --installed | grep 99000 -B1 -A7
Product Name:   SP Server Bits
Product ID:     99000
Version:        3.11
Arch:           x86_64
Status:         Not Subscribed   <========== PASSED: THIS IS EXPECTED BEFORE SUBSCRIBING
Status Details: Not supported by a valid subscription.
Starts:         
Ends:           

[root@rhsm-auto9-client1 ~]# subscription-manager list --available --matches=99000 --pool-only | tail -1
8a889d627d7bfec5017d7bfff4e803c8

[root@rhsm-auto9-client1 ~]# subscription-manager attach --pool=8a889d627d7bfec5017d7bfff4e803c8
Successfully attached a subscription for: SP Starter Pack (S: Premium, R: SP Starter)

[root@rhsm-auto9-client1 ~]# subscription-manager list --installed | grep 99000 -B2 -A7

Product Name:   SP Server Bits
Product ID:     99000
Version:        3.11
Arch:           x86_64
Status:         Not Subscribed   <========== FAILED: EXPECTED "Subscribed"
Status Details: Not supported by a valid subscription.  <===== NOT TRUE
Starts:         11/27/2021                              <===== THIS IS CORRECT
Ends:           11/27/2022                              <===== THIS IS CORRECT


[root@rhsm-auto9-client1 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   SP Starter Pack (S: Premium, R: SP Starter)
Provides:            SP Starter Pack Bits
                     SP Server Bits   <========== THIS PRODUCT IS INSTALLED
SKU:                 sp-starter-pack
Contract:            0
Account:             8020013817
Serial:              7616083683553463030
Pool ID:             8a889d627d7bfec5017d7bfff4e803c8
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               SP Starter
Service Level:       Premium
Usage:               
Add-ons:             
Status Details:      Subscription is currents   <========== CORRECT
Subscription Type:   Standard
Starts:              11/27/2021
Ends:                11/27/2022
Entitlement Type:    Physical



Actual results:
  above

Expected results:
  the installed product listed above should show a status of "Subscribed" after having attach a subscription that provides coverage for it.

Additional info:

Comment 1 John Sefler 2021-12-16 14:04:11 UTC
Pre-Verification using subscription-manager-1.29.21-1.git.54.e56de33.el9.x86_64 which includes the merged pull request.
(unfortunately there is no changelog for the included fix in a CI build of this package)

[root@kvm-07-guest23 ~]# rpm -q subscription-manager
subscription-manager-1.29.21-1.git.54.e56de33.el9.x86_64

[root@kvm-07-guest23 ~]# subscription-manager register --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_rhsmqe_testuser01
Password: 
The system has been registered with ID: 419918de-d1f1-4639-a82a-87223792e471
The registered system name is: kvm-07-guest23.hv2.lab.eng.bos.redhat.com

[root@kvm-07-guest23 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        9.0 Beta
Arch:           x86_64
Status:         Not Subscribed                         <========= CORRECT
Status Details: Not supported by a valid subscription. <========= CORRECT
Starts:                                                <========= CORRECT
Ends:                                                  <========= CORRECT

[root@kvm-07-guest23 ~]# subscription-manager list --available --matches=486 --pool-only | tail -1
8a99f9ad7ac6855d017ae95d0ce00d8e

[root@kvm-07-guest23 ~]# subscription-manager attach --pool=8a99f9ad7ac6855d017ae95d0ce00d8e
Successfully attached a subscription for: Red Hat Beta Access

[root@kvm-07-guest23 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        9.0 Beta
Arch:           x86_64
Status:         Subscribed    <========= CORRECT
Status Details:               <========= CORRECT
Starts:         07/26/2021    <========= CORRECT
Ends:           07/25/2022    <========= CORRECT

[root@kvm-07-guest23 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Beta Access
Provides:            Red Hat Enterprise Linux for Power, little endian Beta
                     Red Hat Enterprise Linux for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for x86_64 Beta
                     Red Hat CodeReady Linux Builder for Power, little endian Beta
                     Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta
                     Red Hat Enterprise Linux for x86_64 Beta   <========== THIS PRODUCT IS INSTALLED
                     Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
                     Red Hat CodeReady Linux Builder for ARM 64 Beta
                     Red Hat Enterprise Linux High Availability Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems Beta
                     Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
                     Red Hat Directory Server Beta
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta
                     Red Hat Enterprise Linux Resilient Storage Beta
                     Red Hat Enterprise Linux for IBM z Systems Beta
                     Red Hat Enterprise Linux for Real Time Beta
                     Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
                     Red Hat Certificate System Beta
                     Red Hat Enterprise Linux for Real Time for NFV Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Enterprise Linux for SAP HANA for x86_64 Beta
                     Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)
SKU:                 RH00069
Contract:            12127446
Account:             6371032
Serial:              4988327914023697400
Pool ID:             8a99f9ad7ac6855d017ae95d0ce00d8e
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Self-Support
Usage:               
Add-ons:             
Status Details:      Subscription is current   <========= CORRECT
Subscription Type:   Standard
Starts:              07/26/2021
Ends:                07/25/2022
Entitlement Type:    Physical


PRE-VERIFIED: The status of an installed product is once again in sync with the attachment of a sku that provides for the installed product.

Comment 4 Rehana 2022-02-07 06:32:39 UTC
Verifying on :
==============

# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.29.23-1.el9

# rpm -qa subscription-manager --changelog | grep 2028969
- 2028969: Do not try to load compliance status from cache (jhnidek)
- 2028969: Do not try to load compliance status from cache (jhnidek)

# subscription-manager register --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: entitlement_rhsm_1
Password: 
The system has been registered with ID: 2e6e1fd2-c469-4f79-b277-204a2424dfa3
The registered system name is: kvm-01-guest29.lab.eng.rdu2.redhat.com

# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        9.0 Beta
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:         
Ends:           


# subscription-manager list --available --matches=486 --pool-only | tail -1
8a99f9ac7d4946d5017d567aee5c0437

# subscription-manager attach --pool=8a99f9ac7d4946d5017d567aee5c0437
Successfully attached a subscription for: Red Hat Beta Access

# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        9.0 Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         11/25/2021
Ends:           11/24/2022

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Beta Access
Provides:            Red Hat Enterprise Linux for Power, little endian Beta
                     Red Hat Enterprise Linux for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for x86_64 Beta
                     Red Hat CodeReady Linux Builder for Power, little endian Beta
                     Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta
                     Red Hat Enterprise Linux for x86_64 Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
                     Red Hat CodeReady Linux Builder for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems Beta
                     Red Hat Enterprise Linux High Availability Beta
                     Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
                     Red Hat Directory Server Beta
                     Red Hat Enterprise Linux for IBM z Systems Beta
                     Red Hat Enterprise Linux Resilient Storage Beta
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta
                     Red Hat Enterprise Linux for Real Time Beta
                     Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
                     Red Hat Certificate System Beta
                     Red Hat Enterprise Linux for Real Time for NFV Beta
                     Red Hat Enterprise Linux for SAP HANA for x86_64 Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)
SKU:                 RH00069
Contract:            
Account:             6378923
Serial:              201589573485825187
Pool ID:             8a99f9ac7d4946d5017d567aee5c0437
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Self-Support
Usage:               
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              11/25/2021
Ends:                11/24/2022
Entitlement Type:    Physical

Status details are now correctly displayed. Moving the bug to Verified!!

Comment 6 errata-xmlrpc 2022-05-17 15:58:31 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 (new packages: subscription-manager), 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-2022:3984