Bug 732152 - AttributeError: 'NoneType' object has no attribute 'getHash'
AttributeError: 'NoneType' object has no attribute 'getHash'
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.2
Unspecified Unspecified
unspecified Severity urgent
: rc
: ---
Assigned To: Bryan Kearney
John Sefler
:
Depends On:
Blocks: rhsm-rhel62
  Show dependency treegraph
 
Reported: 2011-08-19 22:54 EDT by John Sefler
Modified: 2011-12-06 12:23 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 12:23:34 EST
Type: ---
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 John Sefler 2011-08-19 22:54:21 EDT
Description of problem:
The following stack trace occurs throughout our automated test runs against an onpremises candlepin with TESTDATA=1 deployed and all the generated product certs copied to the client....

[root@jsefler-onprem-62server ~]# tail -f /var/log/rhsm/rhsm.log

2011-08-19 22:45:50,856 [INFO]  @connection.py:348 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-08-19 22:45:50,857 [DEBUG]  @connection.py:188 - Loading CA PEM certificates from: /etc/rhsm/ca/
2011-08-19 22:45:50,857 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/fakamai-cp1.pem'
2011-08-19 22:45:50,858 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/jsefler-onprem-62candlepin.pem'
2011-08-19 22:45:50,858 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2011-08-19 22:45:50,859 [DEBUG]  @connection.py:171 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2011-08-19 22:45:50,860 [DEBUG]  @connection.py:209 - Making request: GET /candlepin/
2011-08-19 22:45:50,955 [DEBUG]  @connection.py:216 - Response status: 200
2011-08-19 22:45:50,960 [DEBUG]  @connection.py:377 - Server supports the following resources:
2011-08-19 22:45:50,961 [DEBUG]  @connection.py:378 - {'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-08-19 22:45:50,962 [INFO]  @connection.py:360 - Connection Established: host: jsefler-onprem-62candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2011-08-19 22:45:51,138 [DEBUG]  @cert_sorter.py:70 - Sorting product and entitlement cert status for: 2011-08-19 22:45:51.138321
2011-08-19 22:45:51,186 [DEBUG]  @cert_sorter.py:91 - Installed product IDs: ['100000000000060', '1000000000000023', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '27060', '68', '917571', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000006', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '37090', '37070']
2011-08-19 22:45:51,199 [ERROR]  @managercli.py:62 - exception caught in subscription-manager
2011-08-19 22:45:51,199 [ERROR]  @managercli.py:63 - 'NoneType' object has no attribute 'getHash'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 78, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 69, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1225, in main
    cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 215, in main
    self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1090, in _do_command
    facts, self.options.all, on_date)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 381, in getAvailableEntitlements
    dlist = list_pools(cpserver, consumer_uuid, facts, get_all, active_on)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 354, in list_pools
    facts.update_check(uep, consumer_uuid)
  File "/usr/share/rhsm/subscription_manager/facts.py", line 167, in update_check
    if self.delta() or force:
  File "/usr/share/rhsm/subscription_manager/facts.py", line 96, in delta
    self.facts = self.get_facts()
  File "/usr/share/rhsm/subscription_manager/facts.py", line 124, in get_facts
    self.facts = self._find_facts()
  File "/usr/share/rhsm/subscription_manager/facts.py", line 151, in _find_facts
    facts_dict=facts)
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 76, in __init__
    self._scan_ent_cert_stackable_products()
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 126, in _scan_ent_cert_stackable_products
    product_id = product.getHash()
AttributeError: 'NoneType' object has no attribute 'getHash'


Version-Release number of selected component (if applicable):
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.6-1.git.8.6e109e4.el6.x86_64
[root@jsefler-onprem-62server ~]# rpm -q python-rhsm
python-rhsm-0.96.9-1.git.3.328723e.el6.noarch




How reproducible:


Steps to Reproduce:
[root@jsefler-onprem-62server ~]# subscription-manager register --username testuser1 --password=password --org=admin
The system has been registered with id: 6510950e-cc19-4cbd-a362-56ea35c5dcc2 
[root@jsefler-onprem-62server ~]# subscription-manager list --avail | grep -A1 management-100
ProductId:         	management-100           
PoolId:            	8a90f8c631e50cd80131e50e3b7e0279
--
ProductId:         	management-100           
PoolId:            	8a90f8c631e50cd80131e50e3bcf0281
[root@jsefler-onprem-62server ~]# subscription-manager subscribe --pool=8a90f8c631e50cd80131e50e3b7e0279
Successfully subscribed the system to Pool 8a90f8c631e50cd80131e50e3b7e0279
[root@jsefler-onprem-62server ~]# subscription-manager list --avail
'NoneType' object has no attribute 'getHash'


^^^^^ EXPECTED subscription-manager list --avail TO SHOW ALL THE AVAILABLE SUBSCRIPTIONS.
Comment 1 Adrian Likins 2011-08-24 13:34:23 EDT
should be fixed in master in commit c502646730aece92cbc94c6628aa7ab9d3e02c88


commit c502646730aece92cbc94c6628aa7ab9d3e02c88
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue Aug 23 10:27:21 2011 -0400

    Fix problem with subscribing to products with no product certs
    
    Add the product object to the stackable_product_info dict
    so we can get it directly instead of trying to match against
    the possibly empty (in the case of no installed product)
    all_products dict
Comment 3 Shwetha Kallesh 2011-08-25 02:31:09 EDT
Moving the bug to verified.. 

RPM's used:

subscription-manager-0.96.7-1.git.1.c513aca.el6.x86_64

Steps to reproduce :

[root@sachbeta pki]# subscription-manager register --org=admin --user=testuser1 --password=password
The system has been registered with id: f73b45a3-53de-43eb-b08b-acc7eba49e59 

[root@sachbeta pki]# subscription-manager list --avail | grep -A1 management-100
ProductId:         	management-100           
PoolId:            	ff80808131fb821f0131fb83f8190709
--
ProductId:         	management-100           
PoolId:            	ff80808131fb821f0131fb83f8830712
[root@sachbeta pki]# subscription-manager subscribe --pool=ff80808131fb821f0131fb83f8190709
Successfully subscribed the system to Pool ff80808131fb821f0131fb83f8190709
[root@sachbeta pki]# subscription-manager list --avail
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	ff80808131fb821f0131fb83b8930271
Quantity:          	5                        
Multi-Entitlement: 	No                       
Expires:           	08/23/2012               
MachineType:       	physical                 


ProductName:       	Awesome OS Modifier      
ProductId:         	awesomeos-modifier       
PoolId:            	ff80808131fb821f0131fb83b92e0277
Quantity:          	10                       
Multi-Entitlement: 	No                       
Expires:           	08/23/2012               
MachineType:       	physical
Comment 4 errata-xmlrpc 2011-12-06 12:23:34 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-2011-1695.html

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