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 2026286 - Needs consistent error message in syspurpose modules(role/usage/addon) when an invalid org is used
Summary: Needs consistent error message in syspurpose modules(role/usage/addon) when a...
Keywords:
Status: CLOSED ERRATA
Alias: None
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: Pino Toscano
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 2026013
Blocks: 2037902
TreeView+ depends on / blocked
 
Reported: 2021-11-24 09:47 UTC by Rehana
Modified: 2022-05-17 16:30 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-1.29.23-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2026013
: 2037902 (view as bug list)
Environment:
Last Closed: 2022-05-17 15:58:19 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 2905 0 None Merged 2026286: consider user-specified --org in any case 2021-12-16 13:12:41 UTC
Red Hat Issue Tracker RHELPLAN-103814 0 None None None 2021-11-24 09:49:22 UTC
Red Hat Product Errata RHBA-2022:3984 0 None None None 2022-05-17 15:58:32 UTC

Description Rehana 2021-11-24 09:47:08 UTC
+++ This bug was initially created as a clone of Bug #2026013 +++

Description of problem:
When a user belong to single org tries to list syspurpose values on role/usage/addon with invalid org is succeeds while the old service-level module continues to fail 

Version-Release number of selected component (if applicable):
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.28.24-1.el8

How reproducible:
always 

Steps to Reproduce:
1.On a unregistered system try to list syspurpose values 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 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 the service-level module fails in this scenario 
# 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
Actual results:
only service-level module fails in this scenario

Expected results:
all the other syspurpose module should also fail similar to service-level

Additional info:
We should make sure to be consistent with  similar scenarios in subscription-manager

Comment 1 Archana Pandey 2021-12-27 08:08:10 UTC
Preverification on jenkins build:

reproducing issue on : subscription-manager: 1.29.21-1.el9

[root@kvm-03-guest19 ~]# 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
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager service-level --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager role --list --username rhel9GA --password ****** --org=foo
+-------------------------------------------+ 
               Available role                           <<<<<<<<< org name ignored, should have thrown error
+-------------------------------------------+
 - Red Hat Enterprise Linux Server
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager usage --list --username rhel9GA --password ****** --org=foo
+-------------------------------------------+
               Available usage                          <<<<<<<<< org name ignored, should have thrown error
+-------------------------------------------+
 - Production               
[root@kvm-03-guest19 ~]# subscription-manager addons --list --username rhel9GA --password ****** --org=foo
There are no available values for the system purpose "addons" from the available subscriptions in this organization.       <<<<<<<<< org name ignored, should have thrown error
[root@hpe-dl380pgen8-02-vm-6 ~]#  
[root@hpe-dl380pgen8-02-vm-6 ~]# 
[root@hpe-dl380pgen8-02-vm-6 ~]# 


lets install latest build from jenkins and verify-

[root@kvm-03-guest19 ~]# 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.git.71.2c658b9.el9
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager service-level --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                    <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager role --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                    <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager usage --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                    <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager addons --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                    <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 

verification for sub-man syspurpose sub-modules-

[root@kvm-03-guest19 ~]# subscription-manager syspurpose service-level --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                     <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# subscription-manager syspurpose role --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                     <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# subscription-manager syspurpose usage --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                     <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 
[root@kvm-03-guest19 ~]# subscription-manager syspurpose addons --list --username rhel9GA --password ****** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)                                     <<<<<<<<<<<< expected error message
[root@kvm-03-guest19 ~]# 


Verification result:PASSED - All the syspurpose modules(role/usage/service-level/addons) failing with consistent error message for incorrect org value

Comment 4 Archana Pandey 2022-02-02 06:59:09 UTC
Verifying on subscription-manager-1.29.23-1.el9.x86_64

steps to verify:

[root@dell-per630-fc-01 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.29.23-1.el9
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager service-level --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager role --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager usage --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager addons --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager syspurpose addons --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager syspurpose usage --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager syspurpose role --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# subscription-manager syspurpose service-level --list --username rhel9GA --password redhat@123 --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
[root@dell-per630-fc-01 ~]# 
[root@dell-per630-fc-01 ~]# 

All the syspurpose modules(role/usage/service-level/addons) failing with consistent error message for incorrect org value

Verification : Passed

Comment 6 errata-xmlrpc 2022-05-17 15:58:19 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.