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 1890314 - RFE: allow unprivileged use of repomanage et. al.
Summary: RFE: allow unprivileged use of repomanage et. al.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-21 21:13 UTC by Mason Loring Bliss
Modified: 2021-11-10 07:51 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.28.20-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:37:35 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 2715 0 None Merged [1.28] 1876828: Try to suppress errors in stderr when not run as root 2021-09-17 13:20:47 UTC
Red Hat Product Errata RHBA-2021:4390 0 None None None 2021-11-09 19:37:50 UTC

Comment 2 Mason Loring Bliss 2020-10-21 21:15:07 UTC
1. Proposed title of this feature request

    allow unprivileged use of repomanage et. al.

2. Who is the customer behind the request?

    Bloomberg / The Bureau of National Affairs Inc

Account: Bloomberg BNA 600069
TAM customer: no
CSM customer: no
Strategic: presumed no, unclear

3. What is the nature and description of the request?

Restore behaviour similar to RHEL 7 default.

4. Why does the customer need this? (List the business requirements here)

Automated processes snarled up with extraneous errors.

5. How would the customer like to achieve this? (List the functional requirements here)

Revert behaviour to previous defaults.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

Inherent in request.

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

1890314 filed for this

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

RHEL 8

9. Is the sales team involved in this request and do they have any additional input?

Not involved as yet.

10. List any affected packages or components.

1890314

11. Would the customer be able to assist in testing this functionality if implemented?

yes

Comment 3 amatej 2020-10-27 09:53:01 UTC
Turns out this is a general issue not specific to repomanage.

The error messages come from subscription-manager (therefore a possible workaround is to use --disableplugin=subscription-manager if its not needed) and they show up for any dnf command run as unprivileged (non-root) user.

It is very similar to https://bugzilla.redhat.com/show_bug.cgi?id=1876841, maybe could even be considered duplicate, but like I mentioned the problem is not limited to repomanage and reposync.

Comment 5 Rehana 2021-07-30 09:44:54 UTC
Reproducing the bug :
==================

# 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.28.19-1.el8

# su - test
$ mkdir repo
$ repomanage repo/
2021-07-30 05:42:29,505 [ERROR] repomanage:40212:MainThread @logutil.py:221 - [Errno 13] Permission denied: '/var/log/rhsm/rhsm.log' - Further logging output will be written to stderr
Not root, Subscription Management repositories not updated

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

Error: No files to process

Preverifying the fix on :
==========================

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.19-1
subscription management rules: 5.41
subscription-manager: 1.28.19-1.git.6.c1dd7c3.el8

# su - test
Last login: Thu Jul 29 17:24:00 IDT 2021 on pts/0

$ mkdir repo

$ repomanage repo/
Not root, Subscription Management repositories not updated

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

Error: No files to process

$ tail ~/.cache/rhsm/rhsm.log -n 1
2021-07-29 17:24:21,454 [ERROR] repomanage:54948:MainThread @identity.py:156 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 13] Permission denied: '/etc/pki/consumer/key.pem'

^ Notice now the error log is added to the rhsm.log entry of non-root user. 

Based on the observation , Pre-verifying the bug

Comment 8 Rehana 2021-08-09 14:42:16 UTC
Verifying on :
==============
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.19-1
subscription management rules: 5.41
subscription-manager: 1.28.20-1.el8

$ mkdir repo

$ repomanage repo/
Not root, Subscription Management repositories not updated
Error: No files to process

$ tail ~/.cache/rhsm/rhsm.log -n 1
2021-08-09 10:40:20,265 [ERROR] repomanage:17739:MainThread @identity.py:156 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 13] Permission denied: '/etc/pki/consumer/key.pem'

Based on the above observation , moving the bug to Verified !!

Comment 11 errata-xmlrpc 2021-11-09 19:37:35 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-2021:4390


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