Bug 688028

Summary: Subscription Manager GUI does not start up.
Product: Red Hat Enterprise Linux 6 Reporter: Kenichi Takemura <ktakemur>
Component: subscription-managerAssignee: John Sefler <jsefler>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: alikins, ebaak, jzhao
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-12-06 17:13:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 682238    
Attachments:
Description Flags
Import Certificate result when trying to import an identity cert none

Description Kenichi Takemura 2011-03-16 04:32:51 UTC
Description of problem:

System -> Administration -> Red Hat Subscription Manager does not start the application. I can observe following error in /var/log/rhsm/

2011-03-16 04:21:15,103 [INFO] __init__() @connection.py:298 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-03-16 04:21:15,105 [INFO] __init__() @connection.py:301 - Connection Established: host: subscription.rhn.webqa.redhat.com, port: 443, handler: /subscription
2011-03-16 04:21:15,107 [DEBUG] reload() @managergui.py:164 - Loading consumer info from identity certificates.
2011-03-16 04:21:15,146 [WARNING] bogus() @certificate.py:306 - No product information in certificate: 8130023884513545
2011-03-16 04:25:33,022 [INFO] __init__() @connection.py:298 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-03-16 04:25:33,023 [INFO] __init__() @connection.py:301 - Connection Established: host: subscription.rhn.webqa.redhat.com, port: 443, handler: /subscription
2011-03-16 04:25:33,026 [WARNING] bogus() @certificate.py:306 - No product information in certificate: 8130023884513545
2011-03-16 04:25:33,050 [INFO] perform() @repolib.py:78 - repos updated: 0
2011-03-16 04:25:33,296 [DEBUG] __init__() @certlib.py:661 - Sorting product and entitlement cert status for: 2011-03-16 04:25:33.296449
2011-03-16 04:25:33,298 [DEBUG] _populate_all_products() @certlib.py:679 - Installed product IDs: []
2011-03-16 04:25:33,301 [WARNING] bogus() @certificate.py:306 - No product information in certificate: 8130023884513545
2011-03-16 04:25:33,303 [ERROR] <module>() @certmgr.py:106 - Error while updating certificates using daemon
2011-03-16 04:25:33,304 [ERROR] <module>() @certmgr.py:108 - 'list' object has no attribute 'getStart'
Traceback (most recent call last):
  File "/usr/share/rhsm/certmgr.py", line 104, in <module>
    main()
  File "/usr/share/rhsm/certmgr.py", line 93, in main
    updates = mgr.update()
  File "/usr/share/rhsm/certmgr.py", line 74, in update
    updates += lib.update()
  File "/usr/share/rhsm/factlib.py", line 39, in update
    return action.perform()
  File "/usr/share/rhsm/factlib.py", line 56, in perform
    if facts.delta():
  File "/usr/share/rhsm/facts.py", line 69, in delta
    self.facts = self.get_facts()
  File "/usr/share/rhsm/facts.py", line 98, in get_facts
    self.facts = self.find_facts()
  File "/usr/share/rhsm/facts.py", line 125, in find_facts
    certlib.EntitlementDirectory())
  File "/usr/share/rhsm/certlib.py", line 665, in __init__
    self._scan_entitlement_certs()
  File "/usr/share/rhsm/certlib.py", line 686, in _scan_entitlement_certs
    if ent_cert.valid(on_date=self.on_date):
  File "/usr/lib/python2.6/site-packages/rhsm/certificate.py", line 134, in valid
    range = self.validRange()
  File "/usr/lib/python2.6/site-packages/rhsm/certificate.py", line 403, in validRange
    begin = dt.strptime(order.getStart(), fmt)
AttributeError: 'list' object has no attribute 'getStart'

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-0.95.4-1.el6.x86_64
subscription-manager-0.95.4-1.el6.x86_64
subscription-manager-gnome-0.95.4-1.el6.x86_64

How reproducible:
1/1

Steps to Reproduce:
1. Install RHEL6.1 ja locale
2. Launch Subscription Manager GUI from the Panel
3.
  
Actual results:
Subscription Manager GUI does not start.

Expected results:
Subscription Manager GUI appears.

Additional info:
I tested in ja locale but I do not think this is an i18n issue.

Comment 2 Kenichi Takemura 2011-03-16 05:37:40 UTC
Steps to Reproduce:
1. Install RHEL6.1 ja locale
2. Launch Subscription Manager GUI from the Panel
3. Click "Import Certificate" button.
4. Click Certificate Location,select /etc/pki/consumer/cert.pem.
5. Click "Import Certificate" button.
6. Quit Subscription Manager
7. Launch Subscription Manager GUI from the Panel

Comment 3 Kenichi Takemura 2011-03-16 05:44:04 UTC
Following command works to fix the issue.

# subscription-manager clean

Comment 4 Bryan Kearney 2011-03-16 12:10:25 UTC
Importing an invalid cert causes this issue. Given the work around, I am fine with this being a 6.2 issue.

Comment 6 Adrian Likins 2011-07-26 18:20:19 UTC
Testing this with HEAD from git seems to handle this case, it throws an error message, but no traceback. Looks like this code path has also changed significantly since the report, so far I can't reproduce. I think this is fixed now.

Comment 7 John Sefler 2011-07-28 16:42:51 UTC
Created attachment 515767 [details]
Import Certificate result when trying to import an identity cert

Verifying Version...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.4-1.git.66.43ed963.el6.x86_64

From the stack trace and problem description, its does not appear that the ja locale was a factor in this bug, therefore I will verify the reproduction steps on a en_US.UTF-8 install of rhel62...

# subscription-manager register --username=testuser1 --password=password --org=admin
The system has been registered with id: 15a184e1-c417-4401-8302-0f5c3b00e998 
# ls /etc/pki/consumer/cert.pem 
/etc/pki/consumer/cert.pem
 

^^^ Now an identity cert is on the client and I will start the subscription-manager-gui and attempt to import this identity cert as if were an entitlement certs (Note: I expect to be blocked)

# subscription-manager-gui &

VERIFIED - I am blocked with the attached error dialog and the following is written to the rhsm.log

2011-07-28 12:20:51,633 [ERROR]  @importsub.py:80 - Invalid X509 entitlement certificate.
2011-07-28 12:20:51,636 [ERROR]  @importsub.py:82 - Error parsing manually imported entitlement certificate: /etc/pki/consumer/cert.pem

# ls /etc/pki/entitlement/
#

^^^ Also note that the entitlement directory is empty which means the identity cert was NOT imported as an entitlement

Now...
6. Quit Subscription Manager
7. Launch Subscription Manager GUI from the Panel

Success... the app is launched and not traceback is written to rhsm.log

Moving to VERIFIED.





ADDITIONAL INFO:
The only other test that I can think of that might have cause the original problem is to copy the identity cert manually into the entitlement directory and then try to start the app.  Trying this test, I did the following...

while still registered, i closed the subscription-manager-gui
# cp /etc/pki/consumer/cert.pem /etc/pki/entitlement/
# subscription-manager-gui&

# tail -f /var/log/rhsm/rhsm.log
2011-07-28 12:31:40,667 [INFO]  @connection.py:335 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-07-28 12:31:40,669 [DEBUG]  @connection.py:175 - Loading CA PEM certificates from: /etc/rhsm/ca/
2011-07-28 12:31:40,669 [DEBUG]  @connection.py:160 - Loading CA certificate: '/etc/rhsm/ca/fakamai-cp1.pem'
2011-07-28 12:31:40,670 [DEBUG]  @connection.py:160 - Loading CA certificate: '/etc/rhsm/ca/jsefler-onprem-62candlepin.pem'
2011-07-28 12:31:40,670 [DEBUG]  @connection.py:160 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2011-07-28 12:31:40,671 [DEBUG]  @connection.py:160 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2011-07-28 12:31:40,672 [DEBUG]  @connection.py:196 - Making request: GET /candlepin/
2011-07-28 12:31:40,743 [DEBUG]  @connection.py:203 - Response status: 200
2011-07-28 12:31:40,748 [DEBUG]  @connection.py:364 - Server supports the following resources:
2011-07-28 12:31:40,749 [DEBUG]  @connection.py:365 - {'serials': '/serials', 'status': '/status', 'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'admin': '/admin', 'consumertypes': '/consumertypes', 'statistics/generate': '/statistics/generate', 'content': '/content', 'pools': '/pools', 'products': '/products', 'activation_keys': '/activation_keys', 'atom': '/atom', 'entitlements': '/entitlements', 'events': '/events', 'crl': '/crl', 'rules': '/rules'}
2011-07-28 12:31:40,751 [INFO]  @connection.py:347 - Connection Established: host: jsefler-onprem-62candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2011-07-28 12:31:40,754 [DEBUG]  @managergui.py:161 - Loading consumer info from identity certificates.
2011-07-28 12:31:40,814 [ERROR]  @certlib.py:431 - Reason(s):
 - No order infomation
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 428, in append
    raise Exception('\n - '.join(bogus))
Exception: Reason(s):
 - No order infomation
2011-07-28 12:31:40,815 [ERROR]  @certlib.py:435 - File: /etc/pki/entitlement/cert.pem, not loaded
Reason(s):
 - No order infomation
2011-07-28 12:31:40,843 [ERROR]  @certlib.py:431 - Reason(s):
 - No order infomation

^^^ Although this error occurs and seems appropriate, the subscription-manager-gui still starts as expected and is usable.

Comment 8 errata-xmlrpc 2011-12-06 17:13:13 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.

http://rhn.redhat.com/errata/RHBA-2011-1695.html