Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1973807

Summary: unexpected error message due to an overzealous change from bug 1897767
Product: Red Hat Enterprise Linux 9 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: candlepin-bugs, cdonnell, redakkan, rhsm-qe
Target Milestone: betaKeywords: Triaged
Target Release: 9.0 BetaFlags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.18-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1973731 Environment:
Last Closed: 2021-12-07 21:55:02 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:
Bug Depends On: 1973731    
Bug Blocks:    

Description John Sefler 2021-06-18 18:25:23 UTC
+++ This bug was initially created as a clone of Bug #1973731 +++

Description of problem:

In the following pull request for subscription-manager-1.28 (FBO RHEL-8.5), 
https://github.com/candlepin/subscription-manager/pull/2638/files#

line 904 should not have been changed
https://github.com/candlepin/subscription-manager/pull/2638/files#diff-1396e670b0ee7b2adb272b6e44cd21c4d78c0fe44c0646bf8d8faea82675cfa0L904

please revert back to print(_('Unable to get list of valid values for "{syspurpose_attr}"').format(syspurpose_attr=self.attr))

In the following scenario when bad credentials are used, the former message was the better message....

On RHEL 8.4:
[root@kvm-04-guest13 ~]# rpm -q subscription-manager
subscription-manager-1.28.13-2.el8.x86_64
[root@kvm-04-guest13 ~]# subscription-manager role --list --username=bad-username --password=password
Unable to get list of valid values for "role"

On RHEL 8.5:
[root@kvm-05-guest16 ~]# rpm -q subscription-manager
subscription-manager-1.28.17-1.el8.x86_64
[root@kvm-05-guest16 ~]# subscription-manager role --list --username=bad-username --password=password
This organization does not have any subscriptions that provide a system purpose "role.



Actual results:
This organization does not have any subscriptions that provide a system purpose "role.


Expected results:
Unable to get list of valid values for "role"
(and put a period at the end of the sentence)^


Additional info:


The same fix would also need to be made in the main branch (FBO RHEL9)....
https://github.com/candlepin/subscription-manager/commit/f4d903a88422ee661dc66459305d993b892be91a

Please revert the change on line 350
https://github.com/candlepin/subscription-manager/commit/f4d903a88422ee661dc66459305d993b892be91a#diff-0247574debe612887d14837bd63466752eda54f604cc19f9bfab9810dfe83b6aL350

Expected results:
'Unable to get list of valid values for "{syspurpose_attr}"'
(also add a period at the end of the sentence)

Comment 1 John Sefler 2021-06-18 18:30:15 UTC
This bug was cloned from Bug #1973731 because the same fix is needed in the main branch of subscription-manager for the benefit of RHEL-9.0.

demonstrated here...

On RHEL 8.4:
[root@kvm-04-guest13 ~]# rpm -q subscription-manager
subscription-manager-1.28.13-2.el8.x86_64
[root@kvm-04-guest13 ~]# subscription-manager role --list --username=bad-username --password=password
Unable to get list of valid values for "role"

On RHEL 9.0:
[root@kvm-07-guest23 ~]# rpm -q subscription-manager
subscription-manager-1.29.12-1.el9.x86_64
[root@kvm-07-guest23 ~]# subscription-manager role --list --username=bad-username --password=password
This org does not have any subscriptions with an available "role"


Expected results:
Unable to get list of valid values for "role"
(and put a period at the end of the sentence)^

Comment 2 Rehana 2021-06-30 10:55:46 UTC
Pre-verifying on :
==================

# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.18-1
subscription management rules: 5.41
subscription-manager: 1.29.15-1.git.14.dcbf3e7.el9

#subscription-manager role --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "role".

# subscription-manager syspurpose role --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "role".

# subscription-manager usage --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "usage".

# subscription-manager syspurpose usage --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "usage".

# subscription-manager syspurpose addons --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "addons".

# subscription-manager addons --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "addons".

# subscription-manager service-level --list --username=bad-username --password=password
HTTP error (401 - Unauthorized): Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html

# subscription-manager syspurpose service-level --list --username=bad-username --password=password
HTTP error (401 - Unauthorized): Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html

^^ Notice the messaging on "service-level" module is slightly different , opened a new Bug 1977720 to make service-level error message to be consistent with other system purpose modules.

Setting Verified:Tested

Comment 5 Rehana 2021-07-19 09:55:22 UTC
Verifying on :
=============

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

# rpm -q subscription-manager --changelog | grep 1973807
- 1973807: fix wording on error when listing syspurpose values (#2684)

# subscription-manager role --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "role".

# subscription-manager syspurpose role --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "role".

# subscription-manager usage --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "usage".

# subscription-manager syspurpose usage --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "usage".

# subscription-manager syspurpose addons --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "addons".

# subscription-manager addons --list --username=bad-username --password=password
Unable to get the list of valid values for the system purpose "addons".

#  subscription-manager service-level --list --username=bad-username --password=password
HTTP error (401 - Unauthorized): Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html

# subscription-manager syspurpose service-level --list --username=bad-username --password=password
HTTP error (401 - Unauthorized): Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html

For differences in the messaging in servie-level module , a separate bug has been reported as mentioned earlier . 

Based on the observations, moving the bug to Verified!!