Bug 2156044

Summary: Microdnf is unable to retrieve gpg key on RHEL 8
Product: Red Hat Enterprise Linux 8 Reporter: Sneha Arya <snarya>
Component: librhsmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: swm-qe
Severity: medium Docs Contact: Mariya Pershina <mpershin>
Priority: unspecified    
Version: 8.6CC: kwalker, mbanas, mpershin, nsella
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: librhsm-0.0.3-5.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 09:11: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 Sneha Arya 2022-12-23 14:11:29 UTC
Description of problem:
Microdnf is unable to retrieve gpg key on RHEL 8

Package installation on containers using the custom repository "Hashicorp" in RHEL 8 failed.

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

How reproducible:
100%


Steps to Reproduce:

1) Log into the satellite web UI.
2) Create a content credential called "Hashicorp" of type "GPG Key" in Content-> Content Credentials; paste the "Hashicorp" public key from
   https://rpm.releases.hashicorp.com/gpg
3) Create a product called "Custom" in Content -> Products
4) Create a repository on the Repositories tab called "Hashicorp", with type "yum",
   Upstream URL "https://rpm.releases.hashicorp.com/RHEL/8/x86_64/stable" and GPG key
   "Hashicorp"
5) Change the Download Policy to "On Demand".
6) Sync the repository by selecting it and clicking "Sync Now"
7) Create a content view "Test" and Add the "Hashicorp" repository to it on the Yum Content tab.
8) Click "Publish New Version" and wait for it to finish.

== Client Setup (RHEL-8) ==

1) Register the client host to the satellite server and attach the "Test" Content view on it.
2) Install podman on the RHEL 8 client host and Login to "registry.redhat.io".
# dnf install podman -y
# podman login registry.redhat.io

3) Pull the images from the registry hub.
# podman pull registry.redhat.io/ubi8/ubi-minimal

4) From there on, to reproduce the issue, install execute the following command:
# podman run --rm -it registry.redhat.io/ubi8/ubi-minimal  microdnf --enablerepo=RedHat_Custom_Hashicorp install -y terraform

Actual results:
~~~
...
Downloading metadata...
Downloading metadata...
Package                                                                                                                                             Repository                                                 Size
Installing:                                                                                                                                                                                                        
...
Downloading packages...
error: package terraform-1.3.6-1.x86_64 cannot be verified and repo RedHat_Custom_Hashicorp is GPG enabled: /var/cache/yum/metadata/RedHat_Custom_Hashicorp-8-x86_64/packages/terraform-1.3.6-1.x86_64.rpm could not be verified.
/var/cache/yum/metadata/RedHat_Custom_Hashicorp-8-x86_64/packages/terraform-1.3.6-1.x86_64.rpm:  digest:  SIGNATURE:  NOT OK
~~~

Expected results:
Package installation should be done without error.


Additional info:
1) This issue is not reproducible on "registry.redhat.io/ubi8/ubi" image.
2) This issue was hit on RHEL 7 product that is fixed via the following Bugzilla

   Bug 1708628 - Microdnf unable to retrieve gpg key via http(s)

Comment 16 errata-xmlrpc 2023-05-16 09:11: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 (librhsm 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-2023:3036