Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 2118252

Summary: dnf can't load foreman-protector.py as a regular user
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: PackagingAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: ahumbe, osousa, pcreech
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-1.1.5-1.el8sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:35:16 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:

Description Evgeni Golov 2022-08-15 08:24:53 UTC
Description of problem:
$ dnf search lol
Failed loading plugin "foreman-protector": [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages/dnf-plugins/foreman-protector.py'
…

(the rest of the execution works fine, but the warning is rather useless)

Fixing this, you get:
$ dnf search lol
Last metadata expiration check: 0:07:59 ago on Mon 15 Aug 2022 08:14:13 AM UTC.
Error: Incorrect plugin configuration!

and only after fixing the config perms, you get:

$ dnf search lol
Last metadata expiration check: 0:09:20 ago on Mon 15 Aug 2022 08:14:13 AM UTC.
No matches found.



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

How reproducible:
100%

Steps to Reproduce:
1. dnf search foreman
2.
3.

Actual results:
warnings

Expected results:
no warnings

Additional info:

Comment 1 Evgeni Golov 2022-08-15 08:26:04 UTC
Created redmine issue https://projects.theforeman.org/issues/35366 from this bug

Comment 2 Bryan Kearney 2022-08-15 12:05:11 UTC
Upstream bug assigned to egolov

Comment 3 Bryan Kearney 2022-08-15 12:05:13 UTC
Upstream bug assigned to egolov

Comment 4 jcallaha 2022-08-15 13:12:24 UTC
Does this mean that foreman-protector isn't actually working for that user? Granted they likely can't install anything, but if foreman-protector isn't stopping actions it should (because it isn't running for a user), that would change my opinion of this bug. Thanks!

Comment 5 Evgeni Golov 2022-08-15 14:27:19 UTC
(In reply to jcallaha from comment #4)
> Does this mean that foreman-protector isn't actually working for that user?
> Granted they likely can't install anything, but if foreman-protector isn't
> stopping actions it should (because it isn't running for a user), that would
> change my opinion of this bug. Thanks!

Correct, it is not working at all (as dnf can't load the code), but I don't think this is a big issue as the operations it prohibits are install/upgrade, which the user can't execute anyways.

So, it's more of a cosmetical issue, but still.

Comment 6 Bryan Kearney 2022-08-16 08:05:13 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35366 has been resolved.

Comment 10 Lukas Pramuk 2022-09-22 09:12:01 UTC
VERIFIED.

@Satellite 6.12.0 Snap11
rubygem-foreman_maintain-1.1.5-1.el8sat.noarch

by this simple manual reproducer:

# useradd user
# su - user
$ dnf search lol
Not root, Subscription Management repositories not updated
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)          51 MB/s |  52 MB     00:01    
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)       50 MB/s |  46 MB     00:00    
Last metadata expiration check: 0:00:13 ago on Thu 22 Sep 2022 05:05:57 AM EDT.
Reading Foreman protector configuration
*** Excluded total: 34610

WARNING: Excluding 34610 packages due to foreman-protector. 
Use foreman-maintain packages install/update <package> 
to safely install packages without restrictions.
Use foreman-maintain upgrade run for full upgrade.

No matches found.

>>> there are no warnings/errors when running dnf as non-root user

Comment 14 errata-xmlrpc 2022-11-16 13:35:16 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 (Important: Satellite 6.12 Release), 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/RHSA-2022:8506