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 1876841 - reposync gives misleading ERROR message when run as a non-root user
Summary: reposync gives misleading ERROR message when run as a non-root user
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.0
Assignee: mhorky
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-08 10:24 UTC by Jiri Hladky
Modified: 2021-11-10 07:51 UTC (History)
7 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:33 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 14:01:10 UTC
Red Hat Product Errata RHBA-2021:4390 0 None None None 2021-11-09 19:37:46 UTC

Description Jiri Hladky 2020-09-08 10:24:58 UTC
Description of problem:

When running reposync as a non-root user I'm getting the following ERROR message even when run with with --repofrompath command line argument:

$reposync --repofrompath=tmp,http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/4.18.0/235.el8/ppc64le --repoid=tmp

2020-09-08 12:17:42,926 [ERROR] reposync:778211:MainThread @logutil.py:194 - [Errno 13] Permission denied: '/var/log/rhsm/rhsm.log' - Further logging output will be written to stderr
Not root, Subscription Management repositories not updated
Added tmp repo from http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/4.18.0/235.el8/ppc64le
tmp  
 

This ERROR message is misleading. Could we remove it, at least for the situation when --repofrompath is used? 
                                                                                                                                         

Version-Release number of selected component (if applicable):

$reposync --version
4.2.17


How reproducible:

Run as non-root user this command:
reposync --repofrompath=tmp,http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/4.18.0/235.el8/ppc64le --repoid=tmp


Actual results:

2020-09-08 12:17:42,926 [ERROR] reposync:778211:MainThread @logutil.py:194 - [Errno 13] Permission denied: '/var/log/rhsm/rhsm.log' - Further logging output will be written to stderr
Not root, Subscription Management repositories not updated

Expected results:

No ERROR message.

Comment 1 Daniel Mach 2020-09-14 11:23:31 UTC
The error message seems to be generated by the subscription-manager plugin. Reassigning the component.

Comment 3 Rehana 2021-07-30 09:56:43 UTC
Reproducing the issue :
======================

# 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

Switch to non root user

$ reposync --repofrompath=tmp,http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/ --repoid=tmp
2021-07-30 05:52:29,893 [ERROR] reposync:40480: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.

Added tmp repo from http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/
tmp                  

Preverifying the issue 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

$ reposync --repofrompath=tmp,http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/ --repoid=tmp
Not root, Subscription Management repositories not updated
Added tmp repo from http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/
tmp      

$ tail ~/.cache/rhsm/rhsm.log -n 1
2021-07-30 12:55:08,209 [ERROR] reposync:84312: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 the log entry is now added to rhsm.log in the non-root user's home directory 

Based on the observation, preverifying the bug

Comment 7 Rehana 2021-08-09 14:46:04 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

# rpm -qa subscription-manager --changelog | grep 1876841

# su - test
Last login: Mon Aug  9 10:40:02 EDT 2021 on pts/0

$ reposync --repofrompath=tmp,http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/ --repoid=tmp
Not root, Subscription Management repositories not updated
Added tmp repo from http://download.eng.bos.redhat.com/devel/task-repos/official/kernel/5.14.0/0.rc3.29.el9/x86_64/
tmp          

$ tail ~/.cache/rhsm/rhsm.log -n 1
2021-08-09 10:44:18,112 [ERROR] reposync:17869: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 10 errata-xmlrpc 2021-11-09 19:37:33 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.