RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2022786 - Change the dispalyed message when user tries to list available roles and usage for an invalid org
Summary: Change the dispalyed message when user tries to list available roles and usag...
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2021-12-07
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: subscription-manager
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 9.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 1859157
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-12 15:20 UTC by Rehana
Modified: 2022-05-17 16:29 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.29.21-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1859157
Environment:
Last Closed: 2022-05-17 15:58:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2779 0 None Merged 1859157: Display better error message on incorrect --org 2021-11-12 15:29:23 UTC
Red Hat Issue Tracker RHELPLAN-102625 0 None None None 2021-11-12 15:24:43 UTC
Red Hat Product Errata RHBA-2022:3984 0 None None None 2022-05-17 15:58:22 UTC

Comment 1 Pino Toscano 2021-11-22 13:43:25 UTC
See bug 1859157 comment 6 for few more details on the changes in the UI.

Comment 2 Rehana 2021-11-24 13:09:57 UTC
Pre-Verifying with. :
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.21-1.el9

1. When user belong to multiple org with valid credentials and invalid org is given
===================================================================================
Demonstrating with test data 

User "testuser1" belongs to two org as shown below

# subscription-manager orgs
Username: testuser1
Password: 
+-------------------------------------------+
          testuser1 Organizations
+-------------------------------------------+

Name: Admin Owner
Key:  admin

Name: Snow White
Key:  snowwhite

# subscription-manager usage --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager addons --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager service-level --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
65

Notice the error message and exit codes have been fixed

2 When user belong to multiple org with invalid credentials and invalid org is given
===================================================================================
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager usage --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager addons --list --username testuser1 --password=**** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager service-level --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

Notice the error message and exit codes have been fixed

3. When the user belong to single org ; valid credentials with invalid org 
=======================================================
# subscription-manager usage --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
               Available usage
+-------------------------------------------+
 - Production

# echo $?
0

# subscription-manager role --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Server

# echo $?
0

# subscription-manager service-level --list --username=rhsm_nonsca_1 --password=**** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
# echo $?
65

# subscription-manager addons --list --username=rhsm_nonsca_1 --password=***** --org=foo
There are no available values for the system purpose "addons" from the available subscriptions in this organization.
# echo $?
0

Notice that when valid credentials are issued , org data was not validated except for service-level, there is separate bug 2026286 fix this behaviour

4. When the user belong to single org ; invalid credentials with invalid org 
=======================================================
# subscription-manager usage --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager role --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager service-level --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager addons --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

Based on the above observations marking the bug as verified:tested

Comment 6 Rehana 2021-11-29 12:46:28 UTC
Verifying on :
=============


# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.21-1.el9

1. When user belong to multiple org with valid credentials and invalid org is given
===================================================================================
Demonstrating with test data 

User "testuser1" belongs to two org as shown below

# subscription-manager orgs
Username: testuser1
Password: 
+-------------------------------------------+
          testuser1 Organizations
+-------------------------------------------+

Name: Admin Owner
Key:  admin

Name: Snow White
Key:  snowwhite

# subscription-manager usage --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager addons --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70

# subscription-manager service-level --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
65

Notice the error message and exit codes have been fixed

2 When user belong to multiple org with invalid credentials and invalid org is given
===================================================================================
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager usage --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager addons --list --username testuser1 --password=**** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager service-level --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70

Notice the error message and exit codes have been fixed

3. When the user belong to single org ; valid credentials with invalid org 
=======================================================
# subscription-manager usage --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
               Available usage
+-------------------------------------------+
 - Production

# echo $?
0

# subscription-manager role --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Server

# echo $?
0

# subscription-manager service-level --list --username=rhsm_nonsca_1 --password=**** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
# echo $?
65

# subscription-manager addons --list --username=rhsm_nonsca_1 --password=***** --org=foo
There are no available values for the system purpose "addons" from the available subscriptions in this organization.
# echo $?
0

Notice that when valid credentials are issued , org data was not validated except for service-level, there is separate bug 2026286 fix this behaviour

4. When the user belong to single org ; invalid credentials with invalid org 
=======================================================
# subscription-manager usage --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager role --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager service-level --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

# subscription-manager addons --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70

Based on the above observations ,Moving this bug to Verified!!

Comment 8 errata-xmlrpc 2022-05-17 15:58:12 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 (new packages: subscription-manager), 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-2022:3984


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