Bug 1705912

Summary: dnf copr enable says the repo has no builds even when it has
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Tomecek <ttomecek>
Component: dnf-plugins-coreAssignee: Jakub Kadlčík <jkadlcik>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: low    
Version: 8.0CC: amatej, dmach, emrakova, james.antill, jkadlcik, mdomonko, msuchy
Target Milestone: rcKeywords: Triaged
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: 2019-07-10 12:58:25 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: 1681085    
Bug Blocks:    

Description Tomas Tomecek 2019-05-03 08:15:40 UTC
Description of problem:
Sadly, `dnf copr enable` is unusable since it says there are no builds even when they are. I tested this in ubi8-dev-preview container.


bash-4.4# dnf copr enable packit/packit-service-hello-world                                                                                                                  
Updating Subscription Management repositories.                                                                                                                               
Unable to read consumer identity                                                                                                                                             
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.                                                              

You are about to enable a Copr repository. Please note that this                                                                                                             
repository is not part of the main distribution, and quality may vary.                                                                                                       

The Fedora Project does not exercise any power over the contents of
this repository beyond the rules outlined in the Copr FAQ at                                                                                                                
<https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>,
and packages are not held to any quality or security level.            

Please do not file bug reports about these packages in Fedora                                                                                                               
Bugzilla. In case of problems, contact the owner of this repository.                                                                                                         

Do you really want to enable copr.fedorainfracloud.org/packit/packit-service-hello-world? [y/N]: y                                                                          
Error: This repository does not have any builds yet so you cannot enable it now.  

The repo used only a single chroot: rhel8beta.


I had to workaround by manually downloading the .repo file from copr. Then I was able to install my package.


Related: https://pagure.io/copr/copr/issue/727#comment-568671

Comment 1 Jakub Kadlčík 2019-05-27 13:02:36 UTC
Thank you for the report Tomas,

    dnf copr enable packit/packit-service-hello-world

fails on RHEL8 because when chroot is not explicitly specified, it is guessed based on `distro.linux_distribution()`, so basically based on `/etc/os-release`. This way, the chroot gets determined to be "epel-8-x86_64". The plugin then tries to get the repofile on following URL

    https://copr.fedorainfracloud.org/coprs/packit/packit-service-hello-world/repo/epel-8/

while the RHEL8 in Copr is (so far) known as "rhelbeta-8-*" and therefore the expected address is

    https://copr.fedorainfracloud.org/coprs/packit/packit-service-hello-world/repo/rhelbeta-8/


This can be easily fixed by explicitly specifying your chroot in `dnf copr`

    dnf copr enable packit/packit-service-hello-world rhelbeta-8-x86_64

Or even without architecture

    dnf copr enable packit/packit-service-hello-world rhelbeta-8


The problem is, that as a user you have no way to know this and moreover, you are not supposed to know it. I think, that we should update the suggested command in "Quick Enable" box to specify the chroot when it is needed.

Comment 2 Jakub Kadlčík 2019-05-27 21:30:57 UTC
Modified in PR#763

Comment 4 Jakub Kadlčík 2019-06-03 15:29:37 UTC
> Flags: needinfo?(jkadlcik)

@dmach, what information is needed from me? :-)

Comment 5 Jakub Kadlčík 2019-06-18 20:11:40 UTC
> Modified in PR#763

There is a full URL to the PR
https://pagure.io/copr/copr/pull-request/763

Comment 8 Jaroslav Mracek 2019-07-02 18:19:55 UTC
According to discussion the fix is not part of dnf copr plugin. Probably msuchy will know a detail

Comment 9 Miroslav Suchý 2019-07-04 13:08:22 UTC
The fix is part of copr-fronted, which has not been released (and deployed to production) yet.

Comment 10 Daniel Mach 2019-07-10 12:58:25 UTC
Since the code change was done in copr-frontend, I'm closing this bug.