Bug 1003637 - inst.repo=http://download.fedoraproject.org might end up with "No more mirrors to try"
inst.repo=http://download.fedoraproject.org might end up with "No more mirror...
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-09-02 10:25 EDT by Kamil Páral
Modified: 2015-06-29 08:19 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-06-29 08:19:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
anadonda error screenshot (19.03 KB, image/png)
2013-09-02 10:25 EDT, Kamil Páral
no flags Details
anaconda.log (12.69 KB, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
anaconda-yum.conf (269 bytes, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
packaging.log (935.93 KB, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
program.log (35.43 KB, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
storage.log (129.34 KB, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
syslog (69.84 KB, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details
anaconda.repo (130 bytes, text/plain)
2013-09-02 10:27 EDT, Kamil Páral
no flags Details

  None (edit)
Description Kamil Páral 2013-09-02 10:25:23 EDT
Created attachment 792866 [details]
anadonda error screenshot

Description of problem:
Here's the test case:

I used

In earlier releases, it used to work the same way as yum repo works - it expected that the URL can be a redirect (it is), so it resolved it first (it points to a random mirror), and then operated only on this new URL (the single mirror).

I received this instead:
13:44:18,129 DEBUG packaging: http://download.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/Packages/o/openssl-1.0.1e-18.fc20.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found

It seems that anaconda/yum no longer resolves this redirect, but uses download.fp.o for every request. Of course, that might often result in missing files, because not all mirrors are fully synced all the time. If you get metadata from mirror 1, but download packages from mirror 2, you get these errors.

Of course, this might not happen every time, you have to be "lucky".

Version-Release number of selected component (if applicable):
anaconda 20.9-1
F20 Alpha TC2 x86_64 netinst

How reproducible:
probably just sometimes, I saw this in 2 out of 4 attempts

Steps to Reproduce:
1. boot with inst.repo=http://download.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/ 
2. start installation, maybe receive error

Actual results:
the original url is used for all requests

Expected results:
the url is checked first for redirects, the resulting url is used for all requests

Additional info:
I received the error after my disk layout has been modified by Anaconda. That's unfortunate.
I'm not sure how many people is affected, but this repo can be very often used in automated deployments. I very much assume this is used in Beaker in Red Hat. The private mirror is used, if available, otherwise some close public repo is used instead, all automatically using download.fp.o.
Comment 1 Kamil Páral 2013-09-02 10:27:05 EDT
Created attachment 792875 [details]
Comment 2 Kamil Páral 2013-09-02 10:27:11 EDT
Created attachment 792876 [details]
Comment 3 Kamil Páral 2013-09-02 10:27:22 EDT
Created attachment 792877 [details]
Comment 4 Kamil Páral 2013-09-02 10:27:28 EDT
Created attachment 792878 [details]
Comment 5 Kamil Páral 2013-09-02 10:27:34 EDT
Created attachment 792879 [details]
Comment 6 Kamil Páral 2013-09-02 10:27:42 EDT
Created attachment 792880 [details]
Comment 7 Kamil Páral 2013-09-02 10:27:48 EDT
Created attachment 792881 [details]
Comment 8 Kamil Páral 2013-09-02 10:29:22 EDT
This might and might not be violating https://fedoraproject.org/wiki/Fedora_20_Alpha_Release_Criteria#remote-package-sources and might and might not be considered serious enough to block Alpha/Beta/Final. Proposing for discussion.
Comment 9 Tim Flink 2013-09-03 10:25:18 EDT
I thought that download.fedoraproject.org shouldn't be used for an installation or upgrade source as you end up getting packages from any number of mirrors, doing an implicit mirror lookup every time.
Comment 10 Kamil Páral 2013-09-04 06:42:26 EDT
(In reply to Tim Flink from comment #9)
No, not really. It's even in official repo files as baseurl (they are commented out because mirrorlist urls are recommended as default, but it's there):

$ grep baseurl /etc/yum.repos.d/fedora.repo 

Yum itself handles this well. The only problem I encountered was with fedup and instrepo (bug 886021), but that was kind of waived. Anaconda used to work correctly before. This is the simplest way to provide a http mirror without actually determining a concrete mirror manually.

Of course, we had a similar issue in AutoQA, because we don't download packages using yum code but manually, but that's not relevant here.

In case I'm mistaken, adding Zdenek Pavlas for an advice.
Comment 11 Zdeněk Pavlas 2013-09-04 07:00:09 EDT
> 13:44:18,129 DEBUG packaging: http://download.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/Packages/o/openssl-1.0.1e-18.fc20.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found

> It seems that anaconda/yum no longer resolves this redirect..

Please note that 404 is NOT a redirect!  urlgrabber/curl in the default configuration handles redirects transparently, so this 404 was probably generated after the redirection.

And yes, download.fedoraproject.org redirects, so this seems to prove that there's nothing wrong with redirect handling..

$ telnet download.fedoraproject.org 80
HEAD /pub/fedora/linux/development/20/x86_64/os/Packages/o/openssl-1.0.1e-18.fc20.x86_64.rpm HTTP/1.1
Host: download.fedoraproject.org 

HTTP/1.1 302 FOUND
Date: Wed, 04 Sep 2013 10:55:06 GMT
Server: Apache/2.2.15 (Red Hat)
cache-control: no-cache
location: http://download.eng.brq.redhat.com/pub/fedora/linux/development/20/x86_64/os/Packages/o/openssl-1.0.1e-18.fc20.x86_64.rpm
AppTime: D=33625
AppServer: mirrorlist-phx2.phx2.fedoraproject.org
Content-Type: text/html; charset=utf-8
ProxyTime: D=9690355
ProxyServer: proxy06.fedoraproject.org

Connection closed by foreign host.
Comment 12 Zdeněk Pavlas 2013-09-04 07:29:29 EDT
When you configure a single baseurl that redirects to 10 mirrors, urlgrabber sees just a single mirror. The default failover method is to try all available mirror, so with a single URL that redirects to a mirror that 404s, we give up immediately.

Probably something like this would help: http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=bfb49e

Reuse mirrors when max_retries > len(mirrors).  BZ 765598
Comment 13 Kamil Páral 2013-09-04 08:55:23 EDT
I'm not sure that we understand each other. If I use baseurl=download.fp.o during installation, we need to ensure that we use a the same mirror for retrieving metadata and retrieving packages. The 404 indicates that metadata were retrieved from mirror 1, but the openssl package was most probably attempted to be retrieved from mirror 2 (which was not in sync with mirror 1).

I really believe Anaconda (and the included yum) used to resolve download.fp.o first, remember the resulting mirror URL, and then download all metadata & packages from this $URL. Therefore there were no 404 errors. Am I completely wrong, Zdenek?
Comment 14 Zdeněk Pavlas 2013-09-04 09:20:19 EDT
"302 FOUND" processing is done in curl, and is transparent to urlgrabber/yum/anaconda. If you think that 302 redirects were originally cached, it might be due to:

a) a bug in curl. According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3 clients should NOT cache this.

b) download.fedoraproject.org might have used to send a different cache-control header.

I still don't think we (the client) should 1) handle redirects 2) do it in a non-compliant way.
Comment 15 Kamil Páral 2013-09-04 10:35:45 EDT
In that case, I'm removing AlphaBlocker nomination, since this is not a clear-cut bug anymore. If this is not handled inside yum and never was, then there must have been other circumstances causing "correct" behavior (as Zdenek mentions), or I must have been extremely lucky to never see this bug.

I'll try to investigate some more to check F17/F18 anaconda behavior and yum itself behavior.
Comment 16 Zdeněk Pavlas 2013-09-04 11:03:48 EDT
Now I realized that redirect "caching" involves URLs, not hostnames, and URL obviously changes.. we first ask for repomd.xml, then metadata, then packages.

The location we were redirected previously is thus irrelevant, cached or not. So we're left with two ways to fix this:

a) implement same-mirror retries, and hope that we hit the "right" mirror soon.

b) make the redirect choice at download.fp.o random, but mapping client IPs to mirrors consistently.
Comment 17 Fedora End Of Life 2015-05-29 05:21:31 EDT
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 18 Fedora End Of Life 2015-06-29 08:19:15 EDT
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

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