-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid mirror reported with repoqery --location #1673
Comments
I don't understand what is a bug you report. "dnf5 repoquery --location" does not report where a package was installed from. It reports where a package would be downloaded from. DNF does not validates whether the file exists there. It simply picks a file path from cached repository data, appends it to a mirror URL returned in a cached mirror manager response. Naturally if a content of the mirror has changed in the mean time, then the printed URL will be invalid. DNF cannot know until it tries to request that URL from the server. What behavior do you expect? |
This is not a race condition :)
Yes, except that it would not - and the report was wrong. The URL reported was available on a different mirror, not the one reported.
No content has changed in the meantime. Both before or after asking
At that point in time, the cloudfronts repo was correctly providing newer metadata and DNF did not know that.
DNF should do some basic validation of mirrors, and provide a valid URL (race conditions are acceptable of course). |
One more example:
These mirrors are obviously desynced. RPMs provided by the first mirror may not There might come other questions like
But these are orthogonal in this ticket; these problems happen from time to time and DNF should deal with that. |
DNF obtains a list of up-to-date mirrors from a mirror manager. If there are outdated mirrors on the list, it's a bug in the mirror manager. DNF relies on the list and exploits it for parallel fetching from multiple mirrors. If a download fails, DNF retries from another mirror. So yes, "dnf repoquery --location" can return nonexistent document. I think we could change "dnf repoquery --location" to always use a mirror it downloaded the repository from. The original URL is somewhere cached, I believe. But I don't believe that DNF should actively recheck that given mirror contains the same revision of the repository. It would be too expensive. Or would you expect "dnf repoquery --location" to do a GET/HEAD request on every invocation? |
This would sound better! Btw., how are the particular repositories picked (the one to read metadata and the one reported)? If there's no GET/HEAD checking, is there some intentional round-robin mechanism?
For particular RPMs? Probably no (even though our use-case would be OK with that). For |
If I remember correctly, metadata are fetched from the first item on the list returned by a mirror manager. Mirror manager sorts the list based on location of the client, excluding out-dated mirrors. Mirror manager's reply also contains a current repository revision. DNF then checks that the mirror contains that revision. If it doesn't , next mirror on the list is tried. Regarding downloading packages, I don't know. I believe that the mirrors are tried in the same order as on the list. I have no idea if there is a kind of round robin employed. Maybe the list is already randomized by the mirror manager. But I really don't know. If you are interested, read librepo sources. |
The way you describe the mirroring works, it seems robust. If DNF checks the revision, I'm curious how the problem could appear. |
A similar problem was reported by @kdudka for the epel-7 (yum-utils !) build chroot; occasionally, outdated EPEL 7 mirror is chosen for loading of metadata, and the corresponding RPMs are not available (e.g. wrong |
I don't believe dnf stores where the current metadata were downloaded from and even if it did I don't think it would be that useful. The mirror where the metadata were last downloaded from is just as likely to have moved on as any other.
In the provided output is the updated Can you reproduce with |
I reported this when I was debugging The problem disappeared, and I can't reproduce it now.
We use |
I thought that "dnf repo info" shows real data. You are right. It simply shows first item on the mirror list. |
Interesting, by any chance do you have the logs ( I have found that the Fedora metalink contains (On a side note while I can see one possibility how this bug could happen with |
Unfortunately, I don't have access to the dnf5.log, it is challenging in our testing-farm testsuite to get it, plus this issue is rarely reproducible. I'm waiting for it to happen again. For the affected Mock tests, we haven't set fastestmirror=1. The |
We probably could (it would require extending librepo) but I don't think it is the root cause given that I would like to wait for at least the logs if it will be possible to get them once it happens again. |
Note this output:
The bash with Release=1 is installed there, so I tried to ask where it comes from. It reports the cloudfront.net URL, which is already providing a Release=2 package, though.
It seems that DNF picked a wrong mirror to load (outdated) metadata, and then assumed that all the packages in the bad metadata are also provided even by (up2date) cloudfront mirror, but no longer they are.
See also: https://pagure.io/fedora-infrastructure/issue/12163
This happens with:
But it actually happens with a DNF4 implementation on F40 in the same location (EC2 box, us-east-1).
The text was updated successfully, but these errors were encountered: