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 1781086

Summary: dnf update print lot of errors and traceback when run under regular user
Product: Red Hat Enterprise Linux 8 Reporter: Martin Krajnak <mkrajnak>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact:
Priority: medium    
Version: 8.2CC: james.antill, mblaha
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: subscription-manager-1.26.11-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:49:06 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: 1782910    
Bug Blocks:    

Description Martin Krajnak 2019-12-09 10:16:31 UTC
Description of problem:
I am not sure what is causing this but insted of showing a simple message:
Error: This command has to be run under the root user.

I am now getting lot of errors including tracebacks when both dnf update and yum update is run under regular user.

$ dnf -y update /  yum -y update 
ERROR:root:[Errno 17] File exists: '/var/log/rhsm/' - Further output will be written to stderr
Not root, Subscription Management repositories not updated
INFO:dnf.plugin:Not root, Subscription Management repositories not updated
DEBUG:dnf:DNF version: 4.2.17
DDEBUG:dnf:Command: dnf -y update 
DDEBUG:dnf:Installroot: /
DDEBUG:dnf:Releasever: 8
DEBUG:dnf:cachedir: /var/tmp/dnf-mkrajnak-8a7vsn9u
DDEBUG:dnf:Base command: update
DDEBUG:dnf:Extra commands: ['-y', 'update']
DDEBUG:dnf:Cleaning up.
SUBDEBUG:dnf:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 65, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 98, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 114, in cli_run
    cli.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1145, in run
    self._process_demands()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 814, in _process_demands
    raise dnf.exceptions.Error(_('This command has to be run under the root user.'))
dnf.exceptions.Error: This command has to be run under the root user.
Error: This command has to be run under the root user.
CRITICAL:dnf:Error: This command has to be run under the root user.


Version-Release number of selected component (if applicable):
dnf-4.2.17-1.el8.noarch
libdnf-0.39.1-1.el8.x86_64

How reproducible:
always, reproduced on 2 machines

Expected results:
I think output should be something like:
Error: This command has to be run under the root user.

Additional info:
I am not sure if I could cause this error by some missconfiguration on my system: 
ERROR:root:[Errno 17] File exists: '/var/log/rhsm/' - Further output will be written to stderr

Comment 11 errata-xmlrpc 2020-04-28 16:49:06 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, 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-2020:1823