Bug 841375 - Subscription manager does not see any products.
Subscription manager does not see any products.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity urgent
: rc
: ---
Assigned To: Devan Goodwin
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-07-18 15:33 EDT by J.C. Molet
Modified: 2013-01-07 22:57 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 22:57:23 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description J.C. Molet 2012-07-18 15:33:37 EDT
Description of problem:
Subscription manager does not see any installed products.  This kind of breaks everything.

Version-Release number of selected component (if applicable):
subscription-manager-gui-1.0.9-1.git.37.53fde9a.el5
subscription-manager-1.0.9-1.git.37.53fde9a.el5
python-rhsm-1.0.3-1.git.28.06cccb7.el5

How reproducible:
always

Steps to Reproduce:
1.  Populate /etc/pki/product with product pems
2.  Make sure your product cert dir is set to /etc/pki/product
3.  run subscription-manager list --installed
  
Actual results:
[root@jsefler-rhel59 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.0.9-1.git.37.53fde9a.el5
python-rhsm-1.0.3-1.git.28.06cccb7.el5


[root@jsefler-rhel59 ~]# subscription-manager config --list | grep product
   productcertdir = [/etc/pki/product]
   productcertdir = [/etc/pki/product]
   productcertdir = [/etc/pki/product]
[root@jsefler-rhel59 ~]# ls /etc/pki/product/
69.pem
[root@jsefler-rhel59 ~]# subscription-manager list --installed
No installed products to list
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WTF?  EXPECTED TO SEE THE 69 PRODUCT IN PLAIN ENGLISH

Expected results:
see wtf above.

Additional info:
Comment 1 RHEL Product and Program Management 2012-07-18 15:38:21 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 2 Devan Goodwin 2012-07-19 07:37:03 EDT
Can't reproduce off hand, do you have anything suspicious in your rhsm.log?
Comment 3 Adrian Likins 2012-07-19 15:08:39 EDT
Looks to be a python 2.7ism that doesn't work on rhel5. 


commit b1c8b0b2599aa0bb5b52ec6ba901d76359b3b748
Author: Adrian Likins <alikins@redhat.com>
Date:   Thu Jul 19 15:05:03 2012 -0400

    841375: no string "format" support in python 2.4
    
    Fix issues with "list --installed" (and probably others)

pending review
Comment 4 Devan Goodwin 2012-07-20 08:48:23 EDT
Fixed in python-rhsm master in 6b7d9d57538fb3c33e0819a3704cc6252686648e.

Will appear in 1.0.4, although it's worth noting this issue was caught and fixed without ever being in a tagged build, so 1.0.3 will not experience this issue either.
Comment 5 Devan Goodwin 2012-07-20 08:49:23 EDT
Sorry didn't see Adrian's comment until I got a conflict submitting the bz.
Comment 7 John Sefler 2012-07-20 12:39:15 EDT
Still needs a little work....
[root@nec-em15 ~]# rpm -q subscription-manager python-rhsm python
subscription-manager-1.0.10-1.git.2.fec0032.el5
python-rhsm-1.0.3-1.git.34.b74ea4f.el5
python-2.4.3-53.el5


[root@nec-em15 ~]# subscription-manager list --installed
/usr/lib/python2.4/site-packages/rhsm/certificate.py:123: DeprecationWarning: Call to deprecated function: __init__
  category=DeprecationWarning)
/usr/lib/python2.4/site-packages/rhsm/certificate.py:123: DeprecationWarning: Call to deprecated function: hasDate
  category=DeprecationWarning)
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	
Product ID:           	69
Version:              	
Arch:                 	
Status:               	Partially Subscribed
Starts:               	
Ends:                 	

[root@nec-em15 ~]# 

^^^ SEE PYTHON DEPRECATION WARNINGS AND THE MISSING PRODUCT FIELDS LIKE "Product Name"
Comment 8 Devan Goodwin 2012-07-25 09:09:41 EDT
Ok everything should be in master now, fix is very large and spans both python-rhsm and subscription-manager. Should appear roughly in:

subscription-manager master: d50f08a9574dd15a7f8207ba011b054ff934f63d and subscription-manager-1.0.11-1

python-rhsm master: 399ef0407a8ba25880d52d4c69e68e5f37f4f9f0 and python-rhsm-1.0.4-1
Comment 9 J.C. Molet 2012-07-26 12:01:58 EDT
The changes break the situation futher in now the gui doesn't even start up.  From the rhsm.log



2012-07-26 08:57:28,700 [DEBUG]  @cert_sorter.py:113 - valid entitled products: []
2012-07-26 08:57:28,700 [DEBUG]  @cert_sorter.py:114 - expired entitled products: []
2012-07-26 08:57:28,700 [DEBUG]  @cert_sorter.py:115 - partially entitled products: []
2012-07-26 08:57:28,700 [DEBUG]  @cert_sorter.py:116 - unentitled products: ['100000000000060', '1000000000000023', '1000000041', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '10000000000043', '27060', '69', '37090', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000006', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000008', '100000000000009', '100000000000022', '88888', '38', '37', '42001', '42000', '917571', '37070']
2012-07-26 08:57:28,701 [DEBUG]  @cert_sorter.py:117 - future products: []
2012-07-26 08:57:28,701 [DEBUG]  @cert_sorter.py:118 - partial stacks: []
2012-07-26 08:57:28,701 [DEBUG]  @cert_sorter.py:119 - valid stacks: []
2012-07-26 08:57:28,777 [ERROR]  @subscription-manager-gui:135 - sequence expected, NoneType found
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 118, in ?
    main = managergui.MainWindow(auto_launch_registration=options.register)
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 234, in __init__
    prod_dir=self.product_dir)
  File "/usr/share/rhsm/subscription_manager/gui/installedtab.py", line 107, in __init__
    self.update_products()
  File "/usr/share/rhsm/subscription_manager/gui/installedtab.py", line 160, in update_products
    entry['arch'] = ",".join(product.architectures)
TypeError: sequence expected, NoneType found
Comment 10 J.C. Molet 2012-07-26 12:04:13 EDT
subscription-manager-1.0.11-1.git.0.c60ff3e.el5
python-rhsm-1.0.4-1.git.0.55d31eb.el5
subscription-manager-gui-1.0.11-1.git.0.c60ff3e.el5

The above was tested with this ^^
Comment 11 Devan Goodwin 2012-07-26 12:40:02 EDT
Thanks, looks like we missed a code path for product certs without any architectures defined. Possible quite a few of these little things will pop up. Fix incoming shortly.
Comment 12 Devan Goodwin 2012-07-26 13:02:23 EDT
Fixed in python-rhsm 6e360027b526c96d49040ea3fb2f0efcad4627ee.

Will be in 1.0.5-1.
Comment 13 Shwetha Kallesh 2012-08-03 06:52:25 EDT
Marking verified!!

Verifying version:

[root@dhcp201-115 ~]# rpm -qa | grep subscription-manager
subscription-manager-migration-data-1.11.2.2-1.git.2.c3c8e22.el5
subscription-manager-1.0.11-1.git.18.251f393.el5
subscription-manager-gui-1.0.11-1.git.18.251f393.el5
subscription-manager-firstboot-1.0.11-1.git.18.251f393.el5
subscription-manager-migration-1.0.11-1.git.18.251f393.el5
[root@dhcp201-115 ~]# rpm -qa | grep python-rhsm
python-rhsm-1.0.4-1.git.7.47e5112.el5


[root@dhcp201-115 ~]# subscription-manager config --list | grep product
   productcertdir = [/etc/pki/product]
   productcertdir = [/etc/pki/product]
   productcertdir = [/etc/pki/product]
[root@dhcp201-115 ~]# ls /etc/pki/product/
100000000000000.pem   100000000000002.pem  100000000000006.pem  100000000000060.pem  27060.pem  37065.pem  37069.pem  88888.pem
100000000000001.pem   100000000000003.pem  100000000000011.pem  1144.pem             37060.pem  37067.pem  37070.pem  917571.pem
1000000000000023.pem  100000000000005.pem  100000000000020.pem  1.pem                37062.pem  37068.pem  37080.pem
[root@dhcp201-115 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Awesome OS for ia64 Bits
Product ID:           	100000000000006
Version:              	3.11
Arch:                 	ia64
Status:               	Not Subscribed
Starts:               	
Ends:                 	

Product Name:         	Stackable with Awesome OS for x86_64 Bits
Product ID:           	1000000000000023
Version:              	3.11
Arch:                 	x86_64
Status:               	Subscribed
Starts:               	08/03/2012
Ends:                 	08/03/2013

Product Name:         	Awesome OS Developer Basic
Product ID:           	1144
Version:              	1.0
Arch:                 	ALL
Status:               	Not Subscribed
Starts:               	
Ends:                 	

Product Name:         	Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits
Product ID:           	100000000000011
Version:              	3.11
Arch:                 	x86_64,i686,ia64,ppc,ppc64,s390x,s390
Status:               	Subscribed
Starts:               	08/03/2012
Ends:                 	08/03/2013
Comment 15 errata-xmlrpc 2013-01-07 22:57:23 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-0033.html

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