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 2022788

Summary: On a registered system if user tries to list role/usage/addons using invalid credentials , no error message is thrown
Product: Red Hat Enterprise Linux 9 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: low Docs Contact:
Priority: low    
Version: 9.0CC: arpandey, jsefler, mhorky, redakkan, rhsm-qe, skallesh, zpetrace
Target Milestone: rcKeywords: EasyFix, Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.21-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1859569 Environment:
Last Closed: 2022-05-17 15:58:12 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: 1859569    
Bug Blocks:    

Comment 1 Zdenek Petracek 2021-11-18 12:08:26 UTC
Version:
[root@kvm-02-guest02 ~]# 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.7.c749f0c.el9

Registering a system:
[root@kvm-02-guest02 rhsm]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: *******
Password:
The system has been registered with ID: fd5a08fe-58a4-4145-ac87-7a986dea0192
The registered system name is: kvm-02-guest02.rhts.eng.brq.redhat.com

Pre-verification:
[root@kvm-02-guest02 rhsm]# subscription-manager role --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

[root@kvm-02-guest02 rhsm]# subscription-manager usage --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

[root@kvm-02-guest02 rhsm]# subscription-manager addons --list --username jdkfsl --password ikjko
Error: --username, --password, --token and --org can be used only on unregistered systems

^^ error message is thrown on a registered system --> PASSED

Comment 5 Archana Pandey 2021-11-29 09:57:00 UTC
Beaker Test information:
                         HOSTNAME=kvm-03-guest22.hv2.lab.eng.bos.redhat.com
                            JOBID=6040379
                         RECIPEID=11050126
                    RESULT_SERVER=
                           DISTRO=RHEL-9.0.0-20211128.3
                     ARCHITECTURE=x86_64

[root@kvm-03-guest22 ~]# rpm -qa subscription-manager
subscription-manager-1.29.21-1.el9.x86_64
[root@kvm-03-guest22 ~]# 
[root@kvm-03-guest22 ~]# rpm -qa --changelog subscription-manager | grep 2022788
[root@kvm-03-guest22 ~]# 
[root@kvm-03-guest22 ~]# rpm -qa --changelog subscription-manager | grep 1859569
- 1859569: Abort on invalid username/token option in syspurpose commands
[root@kvm-03-guest22 ~]# 
[root@kvm-03-guest22 ~]# 
[root@kvm-03-guest22 ~]#
[root@kvm-03-guest22 ~]# subscription-manager register --username rhel9GA --password ******* --serverurl subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 07bf13eb-537e-4191-8c49-e235ddf248f6
The registered system name is: kvm-03-guest22.hv2.lab.eng.bos.redhat.com

[root@kvm-03-guest22 ~]# subscription-manager role --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems              <<<<<<<<<< PASS
[root@kvm-03-guest22 ~]# 
[root@kvm-03-guest22 ~]# subscription-manager usage --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems              <<<<<<<<<< PASS
[root@kvm-03-guest22 ~]# 

[root@kvm-03-guest22 ~]# subscription-manager service-level --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems               <<<<<<<<<< PASS

[root@kvm-03-guest22 ~]# subscription-manager addons --list --username sdsfdsf --password fdsfds
Error: --username, --password, --token and --org can be used only on unregistered systems               <<<<<<<<<< PASS


[root@kvm-03-guest22 ~]#   
[root@kvm-03-guest22 ~]# man subscription-manager  | grep "role options" -A 20
   role options
       The role subcommand displays the current configured role preference for products installed on the system. For example, if the role preference is "Red Hat  Enter‐
       prise Linux Server", then a subscription with a "Red Hat Enterprise Linux Server" role is selected when auto-attaching subscriptions to the system.

       --show Shows the system's current role preference. If a role is not set, then there is a message saying it is not set.

       --list Lists the available role system purpose values.

       --username=USERNAME
              Gives the username for the account to use to connect to the organization account [Usable with --list on unregistered systems].

       --password=PASSWORD
              Gives the user account password [Usable with --list on unregistered systems].                           <<<<<<<<<< manual updated

       --token=TOKEN
              Token to use when authorizing against the server [Usable with --list on unregistered systems].           <<<<<<<<<< manual updated

       --org=ORG
              Identifies the organization for which the role applies [Usable with --list on unregistered systems].     <<<<<<<<<< manual updated

       --set=ROLE
[root@kvm-03-guest22 ~]# 

Verified: PASSED

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