Bug 2058471

Summary: dnf copr enable fails to pick epel-9 chroot
Product: Red Hat Enterprise Linux 9 Reporter: Carl George 🤠 <carl>
Component: dnf-plugins-coreAssignee: Copr Team <copr-team>
Status: CLOSED ERRATA QA Contact: swm-qe
Severity: unspecified Docs Contact:
Priority: medium    
Version: CentOS StreamCC: amatej, bstinson, james.antill, jwboyer, mbanas
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.1.0-2.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:15:26 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: 1994154    
Bug Blocks:    

Description Carl George 🤠 2022-02-25 05:03:01 UTC
Description of problem:
When enabling a COPR repo on CentOS Stream 9, it fails to pick an available epel-9 chroot from the COPR repo [0].


Version-Release number of selected component (if applicable):
dnf-plugins-core-4.0.24-3.el9


Steps to Reproduce:
1. podman run -it --rm centos:stream9
2. dnf install 'dnf-command(copr)'
3. dnf copr enable @caddy/caddy


Actual results:
Error: This repository does not have any builds yet so you cannot enable it now.


Expected results:
Repository successfully enabled.


Additional info:
These same steps work on CentOS Stream 8 with dnf-plugins-core-4.0.21-10.el8.  I believe this is due to https://github.com/rpm-software-management/dnf-plugins-core/commit/9a00b1e405b421ae6c33c62f0442770fa6ba590e in 4.0.24, which I view as a regression.  I disagree with the rationale given in that commit message.  CentOS Stream is still Enterprise Linux and is EPEL compatible (with rare exceptions [1]).


[0] https://copr.fedorainfracloud.org/coprs/g/caddy/caddy/
[1] https://docs.fedoraproject.org/en-US/epel/epel-about-next/

Comment 1 Silvie Chlupova 2022-02-25 10:27:17 UTC
Hi Carl,
you do not have centos-stream-9 enabled in your project. Once this commit https://github.com/rpm-software-management/dnf-plugins-core/commit/1a4dbdb35a7d4e791ebbdcd1a26af941a827cc77 will be in the new release you will see a better error message or if you visit the page https://copr.fedorainfracloud.org/coprs/g/caddy/caddy/repo/centos-stream-9/dnf.repo?arch=x86_64 you can see that the chroot doesn't exist in your project. You can still use:
dnf copr enable @caddy/caddy epel-9-x86_64
This will enable epel repo on your centos-stream. The same steps work on centos stream 8 because it uses dnf-plugins-core-4.0.21 and the change happened in dnf-plugins-core-4.0.24.

Comment 2 Carl George 🤠 2022-02-25 15:23:03 UTC
There is no reason to have both the epel-9 and centos-stream-9 chroots enabled for the project.  CentOS Stream is EPEL compatible.  Furthermore, when COPR packages have dependencies from EPEL, the centos-stream-9 chroot is not usable.  When a COPR has an epel-9 chroot, and `dnf copr enable` is run on a CentOS Stream 9 system to enable that COPR, it should pick that chroot.

Comment 3 Carl George 🤠 2022-02-25 15:27:23 UTC
Proposed fix.

https://gitlab.com/redhat/centos-stream/rpms/dnf-plugins-core/-/merge_requests/7

Comment 6 Jaroslav Mracek 2022-07-19 06:40:11 UTC
The bug is fixed by a patch https://github.com/rpm-software-management/dnf-plugins-core/pull/459 that is already merged into upstream.

Comment 12 errata-xmlrpc 2022-11-15 11:15:26 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 (dnf-plugins-core 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-2022:8296