Bug 1749395

Summary: error happens when run connection.UEPConnection.getPoolsList() given a newly created Stage Candlepin user
Product: Red Hat Enterprise Linux 8 Reporter: Li Bin Liu <liliu>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: csnyder, ftan, jsefler, kdelee, redakkan, soliu, wpoteat
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.28.16-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:37:33 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:

Comment 12 William Poteat 2021-03-23 20:11:34 UTC
I need a better explanation of why this is a bug against our applications. The initial bug report shows newly written python code that does not properly handle what is returned from Candlepin when there are no orgs for a user.

The code for subscription-manager accounts for the possibility of a user with no orgs and outputs proper error messaging when needed [user testuser has no org]:


$ sudo subscription-manager orgs --username testuser1 --password password
testuser1 cannot register with any organizations.


$ sudo subscription-manager register --username testuser1 --password password
Registering to: candlepin.example.com:8443/candlepin
testuser1 cannot register with any organizations.

If there is a bug in the way the subscription-manager code handles this scenario, please comment on it.

Comment 14 Shwetha Kallesh 2021-04-28 10:46:28 UTC
Reproducer:


[root@kvm-02-guest06 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.16-1
subscription management rules: 5.41
subscription-manager: 1.28.13-2.el8


[root@kvm-02-guest06 ~]# subscription-manager register --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_test_bug
Password: 
'NoneType' object is not subscriptable
[root@kvm-02-guest06 ~]#

Comment 15 Shwetha Kallesh 2021-04-28 11:02:51 UTC
Pre-verification comments:

[root@ibm-x3650m4-01-vm-05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.16-1
subscription management rules: 5.41
subscription-manager: 1.28.16-1.el8


[root@ibm-x3650m4-01-vm-05 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID c1778257-582b-48df-b560-15796c320c95 has been unregistered
All local data removed
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_test_bug
Password: 
shwetha_test_bug cannot register with any organizations.
^^ now proper message is thrown instead of "'NoneType' object is not subscriptable"

Comment 19 Shwetha Kallesh 2021-05-14 14:23:54 UTC
Verification:

[root@kvm-03-guest08 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.16-1
subscription management rules: 5.41
subscription-manager: 1.28.16-1.el8


[root@kvm-03-guest08 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_test_1                                                                                                                       
Password: 
shwetha_test_1 cannot register with any organizations.
^^ now proper message is thrown instead of "'NoneType' object is not subscriptable"

Comment 22 errata-xmlrpc 2021-11-09 19:37:33 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 (subscription-manager bug fix and enhancement update), 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-2021:4390