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 2037902 - 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 DUPLICATE of bug 2026013
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 2026013 2026286
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-06 19:34 UTC by Chris Snyder
Modified: 2022-01-27 16:57 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.28.25-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2026286
Environment:
Last Closed: 2022-01-07 14:43:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-107012 0 None None None 2022-01-06 19:37:56 UTC

Description Chris Snyder 2022-01-06 19:34:10 UTC
+++ This bug was initially created as a clone of Bug #2026286 +++

+++ 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

--- Additional comment from Archana Pandey on 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 6 Chris Snyder 2022-01-07 14:43:08 UTC

*** This bug has been marked as a duplicate of bug 2026013 ***


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