Bug 1715228

Summary: Running "dnf info" as a non-root user on an available package fails with "No matching Packages to list"
Product: Red Hat Enterprise Linux 8 Reporter: Bryan Gurney <bgurney>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: csnyder, dmach, james.antill, redakkan
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-27 18:05:35 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 Bryan Gurney 2019-05-29 20:22:40 UTC
Description of problem:
Running "dnf info" on a package that is not installed, but is available in an attached repository, fails if executed as a non-root user.

Version-Release number of selected component (if applicable):
dnf-4.0.9.2-5.el8.noarch

How reproducible:
Seems to be 100%, but I've only tried it with the emacs package so far.

Steps to Reproduce:
1. Install RHEL 8.0.0 on a system from the ISO, creating a non-root user.
2. Register the system via subscription-manager in the GUI (or auto-attach).
3. Grant sudo access to the non-root user via "visudo"
4. As the non-root user, execute "dnf info" on a package that is not installed, but should be available in an attached repository.

Actual results:
$ yum info emacs
Not root, Subscription Management repositories not updated
Red Hat Enterprise Linux 8 for x86_64 - AppStre 0.0  B/s |   0  B     00:01    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS  0.0  B/s |   0  B     00:01    
Failed to synchronize cache for repo 'rhel-8-for-x86_64-appstream-rpms', ignoring this repo.
Failed to synchronize cache for repo 'rhel-8-for-x86_64-baseos-rpms', ignoring this repo.
Error: No matching Packages to list


Expected results:
(Something similar to the "sudo dnf info" output)
$ sudo dnf info emacs
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:10 ago on Wed 29 May 2019 03:54:50 PM EDT.
Available Packages
Name         : emacs
Epoch        : 1
Version      : 26.1
Release      : 5.el8
Arch         : x86_64
Size         : 3.2 M
Source       : emacs-26.1-5.el8.src.rpm
Repo         : rhel-8-for-x86_64-appstream-rpms
Summary      : GNU Emacs text editor
URL          : http://www.gnu.org/software/emacs/
License      : GPLv3+ and CC0-1.0
Description  : Emacs is a powerful, customizable, self-documenting, modeless
             : text editor. Emacs contains special code editing features, a
             : scripting language (elisp), and the capability to read mail,
             : news, and more without leaving the editor.
             : 
             : This package provides an emacs binary with support for X windows.



Additional info:
In RHEL 7, running "dnf info" on a non-installed package will successfully show the info for the package.

Note that this failure does not appear for packages that are installed in the "@System" repository:

$ dnf info vdo
Not root, Subscription Management repositories not updated
Red Hat Enterprise Linux 8 for x86_64 - AppStre 0.0  B/s |   0  B     00:01    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS  0.0  B/s |   0  B     00:01    
Failed to synchronize cache for repo 'rhel-8-for-x86_64-appstream-rpms', ignoring this repo.
Failed to synchronize cache for repo 'rhel-8-for-x86_64-baseos-rpms', ignoring this repo.
Installed Packages
Name         : vdo
Version      : 6.2.0.293
Release      : 10.el8
Arch         : x86_64
Size         : 3.9 M
Source       : vdo-6.2.0.293-10.el8.src.rpm
Repo         : @System
From repo    : anaconda
Summary      : Management tools for Virtual Data Optimizer
URL          : http://github.com/dm-vdo/vdo
License      : GPLv2
Description  : Virtual Data Optimizer (VDO) is a device mapper target that
             : delivers block-level deduplication, compression, and thin
             : provisioning.
             : 
             : This package provides the user-space management tools for VDO.

Comment 1 Daniel Mach 2019-06-03 11:33:14 UTC
The root cause seems to be:
> Failed to synchronize cache for repo 'rhel-8-for-x86_64-appstream-rpms', ignoring this repo.
> Failed to synchronize cache for repo 'rhel-8-for-x86_64-baseos-rpms', ignoring this repo.

I believe they can't be downloaded because non-root user doesn't have access to the entitlement certificate.
Reassigning to subscription-manager as these repos are managed by their plugin.

Comment 4 Red Hat Bugzilla 2023-09-14 05:29:27 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days