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 2134165 - [RFE] Guest user running yum command get system not registered message even when the system is actually registered.
Summary: [RFE] Guest user running yum command get system not registered message even ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: ---
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.8
Assignee: Jason Jerome
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 2125227
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-12 16:20 UTC by Rehana
Modified: 2023-05-16 11:10 UTC (History)
7 users (show)

Fixed In Version: subscription-manager-1.28.33-1.el8
Doc Type: Enhancement
Doc Text:
Clone Of: 2125227
Environment:
Last Closed: 2023-05-16 09:07: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 3147 0 None Merged 2134165: [1.28] Fixed incorrect registration warning with yum/dnf 2022-11-04 15:19:44 UTC
Red Hat Issue Tracker ENT-5412 0 None None None 2022-10-13 09:48:45 UTC
Red Hat Issue Tracker RHELPLAN-136261 0 None None None 2022-10-12 16:23:09 UTC
Red Hat Product Errata RHBA-2023:2984 0 None None None 2023-05-16 09:07:36 UTC

Comment 1 Craig Donnelly 2022-10-19 15:45:54 UTC
>> Pre-verification against RHEL-8.8.0-20221017.2:

[root@rhel88 ~]# rpm -q subscription-manager
subscription-manager-1.28.32-1.el8.x86_64

[root@rhel88 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Not Specified

[root@rhel88 ~]# su - testuser
Last login: Wed Oct 19 11:29:08 EDT 2022 on pts/0

[testuser@rhel88 ~]$ yum install vim
Not root, Subscription Management repositories not updated
Error: This command has to be run with superuser privileges (under the root user on most systems).

>> When unregistered, we see:

[root@rhel88 ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.
[root@rhel88 ~]# su - testuser
Last login: Wed Oct 19 11:39:32 EDT 2022 on pts/0

[testuser@rhel88 ~]$ yum install vim
Not root, Subscription Management repositories not updated

This system is not registered with an entitlement server. You can use subscription-manager to register.

Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".

>> LGTM, pre-verified.

Comment 2 Zdenek Petracek 2022-11-04 14:27:37 UTC
Final verification on the SM version:
[root@kvm-02-guest05 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 4.2.10-1
subscription management rules: 5.43
subscription-manager: 1.28.32-1.el8

Registering the system:
[root@kvm-02-guest05 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: zpetracePH03
Password: 
The system has been registered with ID: 9a1e7bd1-2d17-45c1-8519-1340ebcd3320
The registered system name is: kvm-02-guest05.rhts.eng.brq.redhat.com

[root@kvm-02-guest05 ~]# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@kvm-02-guest05 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Not Specified

Switching to testuser and running yum command:
[root@kvm-02-guest05 ~]# su - testuser

[testuser@kvm-02-guest05 ~]$ yum install zsh
Not root, Subscription Management repositories not updated
Error: This command has to be run with superuser privileges (under the root user on most systems).

^^ message "This system is not registered with an entitlement server. You can use subscription-manager to register." was not included => final verification PASSED

Comment 3 John Sefler 2022-11-07 17:14:06 UTC
In comment 1 and comment 2 above, the tests appear to pass (without reporting "This system is not registered with an entitlement server." message) when yum install is attempted as a non-root user when run against subscription-manager-1.28.32-1.   This should not be passing since subscription-manager-1.28.32-1 is older than the fixed-in version.

The reason they appear to pass is due to the attached entitlements.  If you do not auto-attach the system with entitlements, then subscription-manager-1.28.32-1 will incorrectly report "This system is not registered with an entitlement server." when the yum install command is run as a non-root user.

Here is a better reproducer of the failure...

[root@ibm-x3650m4-01-vm-10 ~]# rpm -q subscription-manager
subscription-manager-1.28.32-1.el8.x86_64
[root@ibm-x3650m4-01-vm-10 ~]# 
[root@ibm-x3650m4-01-vm-10 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_rhsmqe_testuser01
Password: 
The system has been registered with ID: 8af169ec-7d17-47d6-b322-228d64f90d80
The registered system name is: ibm-x3650m4-01-vm-10.ibm2.lab.eng.bos.redhat.com
[root@ibm-x3650m4-01-vm-10 ~]# 
[root@ibm-x3650m4-01-vm-10 ~]# useradd guestuser
[root@ibm-x3650m4-01-vm-10 ~]# 
[root@ibm-x3650m4-01-vm-10 ~]# su - guestuser -c "yum install zsh -y"
Not root, Subscription Management repositories not updated

This system is not registered with an entitlement server. You can use subscription-manager to register.  <========= FAILED (THIS SYSTEM IS REGISTERED)

Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".
[root@ibm-x3650m4-01-vm-10 ~]# 





OR when run on a system that has access to non-entitled repos (e.g. Beaker repos)


[root@ibm-x3650m4-01-vm-10 ~]# su - guestuser -c "yum install zsh -y"
Not root, Subscription Management repositories not updated

This system is not registered with an entitlement server. You can use subscription-manager to register.  <========= FAILED (THIS SYSTEM IS REGISTERED)

Error: This command has to be run with superuser privileges (under the root user on most systems).
[root@ibm-x3650m4-01-vm-10 ~]#

Comment 7 Zdenek Petracek 2022-11-09 13:42:43 UTC
Version of SM:
[root@kvm-02-guest09 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 4.2.10-1
subscription management rules: 5.43
subscription-manager: 1.28.32-1.el8

On unregistered system:
[root@kvm-02-guest09 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown

System Purpose Status: Unknown

[root@kvm-02-guest09 ~]# yum install zsh
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.  <--- message is correctly shown here

Last metadata expiration check: 1:04:58 ago on Wed 09 Nov 2022 01:18:14 PM CET.
Dependencies resolved.

On registered system:
[root@kvm-02-guest09 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: zpetracePH03
Password: 
The system has been registered with ID: 58ec36de-c960-47da-a923-143238659e79
The registered system name is: kvm-02-guest09.rhts.eng.brq.redhat.com

[root@kvm-02-guest09 ~]# useradd testuser
[root@kvm-02-guest09 ~]# su - testuser

[testuser@kvm-02-guest09 ~]$ yum install zsh
Not root, Subscription Management repositories not updated

This system is not registered with an entitlement server. You can use subscription-manager to register.  <--- reproducing the bug here, the message should not appear here

Error: This command has to be run with superuser privileges (under the root user on most systems).



Updating SM version:
[root@kvm-02-guest09 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 4.2.10-1
subscription management rules: 5.43
subscription-manager: 1.28.33-1.git.0.34a04aa.el8

On unregistered system:
[root@kvm-02-guest09 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown

System Purpose Status: Unknown

[root@kvm-02-guest09 ~]# yum install zsh
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.  <--- message is correctly shown here

Last metadata expiration check: 1:11:30 ago on Wed 09 Nov 2022 01:18:14 PM CET.
Dependencies resolved.

On registered system:
[root@kvm-02-guest09 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: zpetracePH03
Password: 
The system has been registered with ID: dc215cea-b3a2-4115-a537-74ff061b0da9
The registered system name is: kvm-02-guest09.rhts.eng.brq.redhat.com

[root@kvm-02-guest09 ~]# useradd guestuser
[root@kvm-02-guest09 ~]# su - guestuser

[guestuser@kvm-02-guest09 ~]$ yum install zsh
Not root, Subscription Management repositories not updated
Error: This command has to be run with superuser privileges (under the root user on most systems).

^^ the error is no longer shown here -- PASSED

Comment 12 Zdenek Petracek 2022-11-22 15:59:40 UTC
I reviewed the test results and therefore moving the status from ON_QA to VERIFIED

Comment 15 errata-xmlrpc 2023-05-16 09:07: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 (subscription-manager bug fix and enhancement update), 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-2023:2984


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