Bug 678049

Summary: subscription-manager --autosubscribe feedback for "Subscribed to Products:" appears wrong
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: dgoodwin, jmolet, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:39:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 568421    

Description John Sefler 2011-02-16 16:01:42 UTC
Description of problem:
When autosubscribing from the subscription-manager cli against my onpremises candlepin deployed with TESTDATA=1, feekback with "Subscribed to Products:" is given that does not match what is actually subscribed.


Version-Release number of selected component (if applicable):
[root@jsefler-onprem01 ~]# rpm -qa | grep subscription-manager
subscription-manager-gnome-0.93.19-1.git.0.ed24ca5.el6.x86_64
subscription-manager-0.93.19-1.git.0.ed24ca5.el6.x86_64
subscription-manager-firstboot-0.93.19-1.git.0.ed24ca5.el6.x86_64
[root@jsefler-onprem01 ~]# curl -k https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/status
{
  "version" : "0.1.37",
  "result" : true,
  "release" : "1%{?dist}"
}

How reproducible:


Steps to Reproduce:
In the autosubscribe command below, the "Subscribed to Products:" includes many products (such as "RHEL Personal Bits", "RHEL Personal SVC", "Red Hat Open Dos", etc.) which when viewed in the subsequent call to 'subscription-manager list --installed' appear with a status of "Not Subscribed"....


[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password password --autosubscribe
f5eec84e-4214-4437-85c6-2a151e34e335 jsefler-onprem01.usersys.redhat.com
Subscribed to Products:
     RHEL Personal SVC(1)
     RHEL for Physical Servers SVC(37060)
     PRAD390 Awesome OS for IBM s390x systems(100000000000000)
     RHEL for Premium Architectures SVC(37062)
     Shared Storage (GFS)(37067)
     Red Hat Linux 4.0(1000000041)
     This product makes RHEL-server 50% more RHEL!(42001)
     Flexible Hypervisor(Premium Architectures-15-pack)(37)
     Smart Management (RHN Management & Provisioning)(37069)
     Flexible Hypervisor(Physical Servers-Unlimited)(38)
     RHEL for Workstations SVC(27060)
     This product makes mkt RHEL-server 50% more awesome(42000)
     Large File Support (XFS)(37068)
     High availability (cluster suite)(37065)
     Red Hat Open Dos(10000000000043)
     Load Balancing(37070)
     IPA Engineering Product(917571)
     RHEL Personal Bits(1144)
[root@jsefler-onprem01 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	PRAD390 Awesome OS for IBM s390x systems
Status:             	Subscribed               
Expires:            	2012-02-15               
Subscription:       	11297869879260253        
ContractNumber:     	27                       
AccountNumber:      	12331131231              


ProductName:        	This product makes mkt RHEL-server 50% more awesome
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	RHEL Personal Bits       
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	RHEL Personal SVC        
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	Large File Support (XFS) 
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	RHEL for Premium Architectures SVC
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	RHEL for Workstations SVC
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	1129786987971310         
ContractNumber:     	6                        
AccountNumber:      	12331131231              


ProductName:        	Load Balancing           
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	High availability (cluster suite)
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	Flexible Hypervisor(Physical Servers-Unlimited)
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	Red Hat Open Dos         
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	RHEL for Physical Servers SVC
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	Red Hat Linux 4.0        
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	IPA Engineering Product  
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	Smart Management (RHN Management & Provisioning)
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	This product makes RHEL-server 50% more RHEL!
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:      	                         


ProductName:        	Shared Storage (GFS)     
Status:             	Subscribed               
Expires:            	2012-03-15               
Subscription:       	11297869879521104        
ContractNumber:     	1                        
AccountNumber:      	12331131231              


ProductName:        	Flexible Hypervisor(Premium Architectures-15-pack)
Status:             	Not Subscribed           
Expires:            	                         
Subscription:       	                         
ContractNumber:     	                         
AccountNumber:

Comment 2 John Sefler 2011-02-17 02:27:40 UTC
Food for thought...

Here's an example of a more informative way to display autosubscribe feedback:

# subscription-manager register --username=testuser1 --password password --autosubscribe
f5eec84e-4214-4437-85c6-2a151e34e335 jsefler-onprem01.usersys.redhat.com
Installed Products:
     RHEL Personal SVC (1) - Subscribed
     RHEL for Physical Servers SVC (37060) - Not Subscribed
     PRAD390 Awesome OS for IBM s390x systems (100000000000000) - Subscribed
     RHEL for Premium Architectures SVC (37062) - Subscribed
     Shared Storage (GFS) (37067) - Not Subscribed
     Red Hat Linux 4.0 (1000000041) - Not Subscribed


The advantage of this format is that it explicitly tells you:
- what products are installed
- what was auto-subscribed
- what was not auto-subscribed
- the product_hashs (not sure if this info is necessary, but it doesn't hurt)

Comment 4 Devan Goodwin 2011-02-21 17:43:04 UTC
The code was attempting auto-subscribe for all installed products, and then just assuming that they were all granted. Changed to instead refresh certs and query current status.

Installed Products:
   Load Balancing Bits - Subscribed
   Awesome OS Premium Architecture Bits - Not Subscribed
   Clustering Bits - Subscribed
   Multiplier Product Bits - Not Subscribed
   Awesome OS Modifier Bits - Subscribed
   Large File Support Bits - Subscribed
   Management Bits - Subscribed
   Awesome OS for S390X Bits - Not Subscribed
   Awesome OS Server Bits - Subscribed
   Awesome OS Developer Bits - Not Subscribed
   Awesome OS Scalable Filesystem Bits - Subscribed
   Awesome OS Developer Basic - Not Subscribed
   Awesome OS Workstation Bits - Subscribed
   Shared Storage Bits - Subscribed

Fixed in master in: 2d48f6b21b9b60f9c88cdb7bddc138b0b4efc05b
Should appear in: subscription-manager-0.96.2

Comment 6 J.C. Molet 2011-02-21 19:35:00 UTC
verified for me.


[root@jmolet-vm1 ~]# subscription-manager register --user=testuser1 --password=password --autosubscribe
1f2f2478-4ef5-4175-b804-e14156420fa5 jmolet-vm1.usersys.redhat.com
Installed Products:
   Awesome OS Workstation Bits - Subscribed
   Clustering Bits - Subscribed
   Large File Support Bits - Subscribed
   Awesome OS Server Bits - Subscribed
   Management Bits - Subscribed
   Awesome OS Scalable Filesystem Bits - Subscribed
   Awesome OS Modifier Bits - Subscribed
   Awesome OS Developer Bits - Not Subscribed
   Awesome OS for S390X Bits - Not Subscribed
   Awesome OS Premium Architecture Bits - Not Subscribed
   Multiplier Product Bits - Not Subscribed
   Shared Storage Bits - Subscribed
   Awesome OS Developer Basic - Not Subscribed
   Load Balancing Bits - Subscribed
[root@jmolet-vm1 ~]# rhsm-version
subscription-manager-gnome-0.96.1-1.git.17.2d48f6b.git.17.2d48f6b.el6.x86_64
subscription-manager-firstboot-0.96.1-1.git.17.2d48f6b.git.17.2d48f6b.el6.x86_64
python-rhsm-0.96.2-1.git.0.35fe684.el6.noarch
subscription-manager-0.96.1-1.git.17.2d48f6b.git.17.2d48f6b.el6.x86_64

Comment 7 John Sefler 2011-02-21 21:09:54 UTC
Can this fix be added to the RHEL6 branch too? subscription-manager-0.95.X

Comment 8 Devan Goodwin 2011-02-22 13:12:58 UTC
Can do.

RHEL6: 4a23267dcdb77a0d7ece6fbf81c170714f2fe0ea
Should appear in version: subscription-manager-0.95.2

Comment 9 J.C. Molet 2011-02-24 19:07:30 UTC
This now works in RHEL6 branch.


[root@jmolet-vm0 ~]# subscription-manager unregister
System has been un-registered.
[root@jmolet-vm0 ~]# subscription-manager register --user=testuser1 --password=password --autosubscribe
5c401d60-da7d-4e80-8031-c68b40868ef4 jmolet-vm0.usersys.redhat.com
Installed Products:
   Clustering Bits - Subscribed
   Shared Storage Bits - Subscribed
   Large File Support Bits - Subscribed
   Load Balancing Bits - Subscribed
   Awesome OS Developer Bits - Not Subscribed
   Multiplier Product Bits - Not Subscribed
   Awesome OS Modifier Bits - Subscribed
   Awesome OS Scalable Filesystem Bits - Subscribed
   Awesome OS Server Bits - Subscribed
   Awesome OS Workstation Bits - Subscribed
   Management Bits - Subscribed
   Awesome OS for S390X Bits - Not Subscribed
   Awesome OS Developer Basic - Not Subscribed
   Awesome OS Premium Architecture Bits - Not Subscribed
[root@jmolet-vm0 ~]# rhsm-version 
python-rhsm-0.95.3-1.git.0.4d0ef8e.el6.noarch
subscription-manager-gnome-0.95.2-1.git.0.5c88aa0.el6.x86_64
subscription-manager-firstboot-0.95.2-1.git.0.5c88aa0.el6.x86_64
subscription-manager-0.95.2-1.git.0.5c88aa0.el6.x86_64

Comment 10 John Sefler 2011-02-27 14:56:22 UTC
Sorry, I should have asked earlier...
Can this fix be added to the BETA branch too? subscription-manager-0.93.X

Comment 11 Devan Goodwin 2011-02-28 13:30:36 UTC
BETA: 6e8ccd74e5a831df663f0a7621ad0c60a6b52db9
Should appear in: subscription-manager-0.93.20-1

Do you need a rebuild or is git ok for now?

Comment 12 John Sefler 2011-02-28 20:53:11 UTC
Also verifying the fix on the BETA branch...
[root@jsefler-onprem01 ~]# rpm -qa | grep subscription-manager
subscription-manager-firstboot-0.93.19-1.git.1.6e8ccd7.el6.x86_64
subscription-manager-0.93.19-1.git.1.6e8ccd7.el6.x86_64
subscription-manager-gnome-0.93.19-1.git.1.6e8ccd7.el6.x86_64

[root@jsefler-onprem01 ~]# subscription-manager register --user=testuser1 --password=password --autosubscribe
d43d8e76-6751-4ad6-97fd-4afb51e3bcbe jsefler-onprem01.usersys.redhat.com
Installed Products:
   PRAD390 Awesome OS for IBM s390x systems - Subscribed
   This product makes mkt RHEL-server 50% more awesome - Not Subscribed
   RHEL Personal Bits - Not Subscribed
   RHEL Personal SVC - Not Subscribed
   Large File Support (XFS) - Subscribed
   RHEL for Premium Architectures SVC - Not Subscribed
   RHEL for Workstations SVC - Subscribed
   Load Balancing - Subscribed
   High availability (cluster suite) - Subscribed
   Flexible Hypervisor(Physical Servers-Unlimited) - Not Subscribed
   Red Hat Open Dos - Not Subscribed
   RHEL for Physical Servers SVC - Subscribed
   Red Hat Linux 4.0 - Not Subscribed
   IPA Engineering Product - Not Subscribed
   Smart Management (RHN Management & Provisioning) - Subscribed
   This product makes RHEL-server 50% more RHEL! - Not Subscribed
   Shared Storage (GFS) - Subscribed
   Flexible Hypervisor(Premium Architectures-15-pack) - Not Subscribed
[root@jsefler-onprem01 ~]# 


Devan,
Verified on master, RHEL6, and BETA branches.  No need yet for a brew build.

Comment 13 errata-xmlrpc 2011-05-19 13:39:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html