Bug 1432947

Summary: GUI: AttributeError: 'NoneType' object has no attribute 'id' when tried to list all available subscription from gui against a golden ticket enabled org
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: high    
Version: 7.4CC: bcourt, jstavel, khowell, redakkan, skallesh, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 19:21:47 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:
Attachments:
Description Flags
error
none
All_availableTab none

Description Rehana 2017-03-16 12:56:23 UTC
Created attachment 1263683 [details]
error

Description of problem:
Observed error message AttributeError: 'NoneType' object has no attribute 'id' when tried to list all available subscription from subscription-manager-gui against a golden ticket enabled org

Version-Release number of selected component (if applicable):
subscription management server: 2.0.26-1
subscription management rules: 5.21
subscription-manager: 1.19.1-1.git.832.46d4712.el7
python-rhsm: 1.19.1-1.git.5753.46d4712.el7

How reproducible:
always against "snowwhite" org that have the "contentaccessmode" enabled

Steps to Reproduce:
1.Register client against "snowwhite"
2. launch subscription-manager-gui
3. move to "all available subscriptions" tab , hit "update"

Actual results:
Observed error (PFA: error.png)

Expected results:
Should list all the available subscriptions 

Additional info:
The issue is observed on both RHEL69 and RHEL74 machines having 1.19+ build
The issue is observed only against the org that had the contentaccessmode enabled, against "admin" org it works as normal 

rhsm.log
---------
2017-03-16 18:19:32,867 [INFO] subscription-manager-gui:8116:AsyncPoolRefreshThread @connection.py:509 - Response: status=200, requestUuid=dfbccfa1-4f34-405b-9c9b-fec04d41d592, request="GET /candlepin/owners/snowwhite/pools?consumer=845d0ea2-9803-428e-9b42-84e2b4d56978&listall=true"
2017-03-16 18:19:32,892 [ERROR] subscription-manager-gui:8116:MainThread @utils.py:69 - 'NoneType' object has no attribute 'id'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/subscription_manager/async.py", line 43, in _run_refresh
    self.pool.refresh(active_on)
  File "/usr/lib/python2.7/site-packages/subscription_manager/managerlib.py", line 503, in refresh
    self.subscribed_pool_ids = self._get_subscribed_pool_ids()
  File "/usr/lib/python2.7/site-packages/subscription_manager/managerlib.py", line 539, in _get_subscribed_pool_ids
    return [ent.pool.id for ent in require(ENT_DIR).list()]
AttributeError: 'NoneType' object has no attribute 'id'

Comment 1 Barnaby Court 2017-03-16 14:47:57 UTC
Rehana, do you see this issue on a sub-man earlier than 1.19?

Comment 2 Rehana 2017-03-17 06:03:20 UTC
(In reply to Barnaby Court from comment #1)
> Rehana, do you see this issue on a sub-man earlier than 1.19?

I retested the scenario on RHEL69 machine with the below mentioned version and yes i get the same behavior there as well(got the same error message)

Tested with the version :
subscription management server: 2.0.26-1
subscription management rules: 5.21
subscription-manager: 1.18.10-1.el6
python-rhsm: 1.18.6-1.el6

rhsm.log
==========

2017-03-17 01:58:59,275 [INFO] rhsmd:27718:MainThread @connection.py:758 - Connection built: host=F21-candlepin.usersys.redhat.com port=8443 handler=/candlepin auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2017-03-17 01:59:00,659 [INFO] rhsmd:27718:MainThread @connection.py:525 - Response: status=200, requestUuid=49dc33b8-98dd-4b7c-b79c-7735b4ecf6f4, request="GET /candlepin/consumers/ac59f9c1-76bb-42f1-896b-2a9e56b4b086/compliance"
2017-03-17 01:59:00,663 [INFO] rhsmd:27718:MainThread @cert_sorter.py:205 - Product status: valid_products= partial_products= expired_products= unentitled_producs=69 and 32060 future_products= valid_until=None
2017-03-17 02:00:08,361 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @hwprobe.py:918 - collected virt facts: virt.is_guest=True, virt.host_type=kvm, virt.uuid=df8ef291-89c3-7f90-81fd-a916d3cc994f
2017-03-17 02:00:08,363 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @cache.py:398 - Server does not support packages, skipping profile upload.
2017-03-17 02:00:10,043 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @connection.py:525 - Response: status=200, requestUuid=76bd10b1-9fe7-44ae-9eed-11886270ebf7, request="GET /candlepin/consumers/ac59f9c1-76bb-42f1-896b-2a9e56b4b086/owner"
2017-03-17 02:00:13,865 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @connection.py:525 - Response: status=200, requestUuid=62392e1f-f15c-49f0-9260-e6b9db638cb5, request="GET /candlepin/owners/snowwhite/pools?consumer=ac59f9c1-76bb-42f1-896b-2a9e56b4b086"
2017-03-17 02:00:13,978 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @hwprobe.py:918 - collected virt facts: virt.is_guest=True, virt.host_type=kvm, virt.uuid=df8ef291-89c3-7f90-81fd-a916d3cc994f
2017-03-17 02:00:13,979 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @cache.py:398 - Server does not support packages, skipping profile upload.
2017-03-17 02:00:15,384 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @connection.py:525 - Response: status=200, requestUuid=258e6a87-0aca-4d5d-8855-a81d31cd6c4e, request="GET /candlepin/consumers/ac59f9c1-76bb-42f1-896b-2a9e56b4b086/owner"
2017-03-17 02:00:19,205 [INFO] subscription-manager-gui:27588:AsyncPoolRefreshThread @connection.py:525 - Response: status=200, requestUuid=49d7d811-4e13-4e97-b469-215c53b428af, request="GET /candlepin/owners/snowwhite/pools?consumer=ac59f9c1-76bb-42f1-896b-2a9e56b4b086&listall=true"
2017-03-17 02:00:19,270 [ERROR] subscription-manager-gui:27588:MainThread @utils.py:72 - 'NoneType' object has no attribute 'id'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 55, in <module>
    logging.captureWarnings(True)
AttributeError: 'module' object has no attribute 'captureWarnings'
c^C

Comment 4 Rehana 2017-04-18 07:13:35 UTC
Retested with ;

subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.8-1.el7
python-rhsm: 1.19.5-1.el7


No error message is observed on the subscription-manager GUI during listing all available subscriptions against a golden ticket enabled org, all the available subscriptions where listed on GUI.(PFA:All_availableTab.png) 

Marking as Verified!!

Comment 5 Rehana 2017-04-18 07:13:58 UTC
Created attachment 1272231 [details]
All_availableTab

Comment 6 errata-xmlrpc 2017-08-01 19:21:47 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.

https://access.redhat.com/errata/RHBA-2017:2083