Bug 1649898 - [download] --url[s] option always "fails to get mirror for package"
Summary: [download] --url[s] option always "fails to get mirror for package"
Keywords:
Status: CLOSED DUPLICATE of bug 1649284
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-14 18:07 UTC by Jan Pokorný [poki]
Modified: 2018-11-22 13:50 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-22 13:50:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Pokorný [poki] 2018-11-14 18:07:05 UTC
Examples:

# dnf download --urls firefox
> Last metadata expiration check: [...]
> Error: Failed to get mirror for package: firefox

# dnf download --debuginfo --urls firefox
> enabling rawhide-debuginfo repository
> Last metadata expiration check: [...]
> Error: Failed to get mirror for package: firefox-debuginfo

Without --url[s] option, it does the job just fine, so hopefully
an easyfix.

# rpm -q --whatprovides 'dnf-command(download)' dnf librepo libdnf
> dnf-plugins-core-4.0.0-4gb1f33da.fc30.noarch
> dnf-4.0.4-2.fc30.noarch
> librepo-1.9.2-1.fc30.x86_64
> libdnf-0.22.0-8.fc30.x86_64

Comment 1 Jaroslav Mracek 2018-11-21 13:35:23 UTC
I created two patches (https://github.com/rpm-software-management/libdnf/pull/625 and https://github.com/rpm-software-management/dnf/pull/1249) that should solve the issue.

*** This bug has been marked as a duplicate of bug 1649284 ***

Comment 2 Jan Pokorný [poki] 2018-11-21 18:02:10 UTC
Just updated to {python3-,}dnf-4.0.8-0.26gb9a915f0.fc30.noarch
(b9a915f0 > 3d40275c)
and {python3-,}dnf-plugins-core-4.0.2-0.21gbd00656.fc30.noarch
and the problem persists.

Also, there's a strange discrepancy:

$ dnf --version
> 4.0.5
  ^^^^^
>   Installed: dnf-0:4.0.8-0.26gb9a915f0.fc30.noarch at Wed 21 Nov 2018 05:53:19 PM GMT
                     ^^^^^
>   Built    :  at Tue 20 Nov 2018 02:26:14 AM GMT
> 
>   Installed: rpm-0:4.14.2.1-2.fc30.x86_64 at Fri 26 Oct 2018 08:37:58 AM GMT
>   Built    : Fedora Project at Wed 24 Oct 2018 02:26:45 PM GMT

though that may be a fallout from building nightlies.

Comment 3 Jaroslav Mracek 2018-11-21 20:09:04 UTC
I am  sorry, but I am not able to reproduce it. Please can you provide information about available repos on your system? Or probably find a reproducer with only one repository? Thanks a lot.

Comment 4 Jan Pokorný [poki] 2018-11-22 00:02:46 UTC
On a closer look, the problem was perhaps with stale or generally
pre-fix tainted metadata?

After "dnf clean all" and subsequent refetch of metadata, it started
to work.

If that's indeed the case (I don't know), shouldn't there be an update
mechanism devised (e.g. touching a dedicated persistent file) that would
force a subsequent cached metadata invalidation upon the next used of
dnf and force that whenever the new dnf build is known to require that?

We can close this bug regardless.

Comment 5 Jan Pokorný [poki] 2018-11-22 07:59:29 UTC
Indeed, I suspect it was because of "tainted metadata".

I downgraded back to {python3-,}dnf-4.0.4-2.fc30.noarch and
{python3-,}dnf-plugins-core-4.0.0-2.fc30.noarch.

Then immediately run:

# dnf download --urls --urlprotocols https firefox
> https://mirrors.nic.cz/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/f/firefox-63.0.3-1.fc30.x86_64.rpm

# dnf clean all
> 12 files removed

# dnf download --urls --urlprotocols https firefox
> Copr repo for dnf-nightly owned by rpmsoftwaremanagement  [...] 200 kB [...]
> Fedora - Rawhide - Developmental packages for the next Fe [...]  63 MB [...]
> Error: Failed to get mirror for package: firefox

Regarding the invalidation mechanism, something like generating said
dedicated files in %post and %postun (two files to be able to tell
old and new dnf version), then having dnf do some extra evaluations
whether the cache invalidation (an which parts perhaps) is needed
upon it's first subsequent run incl. removal of those files?
If the problem is not completely elsewhere, of course, but if not
we can repurpose this bug along those lines.

Comment 6 Jaroslav Mracek 2018-11-22 13:50:17 UTC

*** This bug has been marked as a duplicate of bug 1649284 ***


Note You need to log in before you can comment on or make changes to this bug.