Bug 440428 - yum-fastestmirror doesn't care about -C flag
yum-fastestmirror doesn't care about -C flag
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Luke Macken
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-03 10:39 EDT by Konstantin Zemlyak
Modified: 2016-09-19 22:38 EDT (History)
5 users (show)

See Also:
Fixed In Version: 1.1.14-4.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-08 13:18:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Konstantin Zemlyak 2008-04-03 10:39:29 EDT
Description of problem:
yum-fastestmirror doesn't care about -C flag and tries to fetch mirrorlist even
when no network access is available, which in turn terminates yum.

Version-Release number of selected component (if applicable):
yum-utils1.1.11-1.fc8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Make sure yum and yum-utils are installed.
2. Disconnect from network (like ifdown interface)
3. yum -C list
Yum bails out while trying to get mirrorlist.
4. yum -C --noplugins list
Should work, confirming that the source of the bug is in plugin.


Actual results:
$ LANG=C yum -C list
Loading "presto" plugin
Loading "fastestmirror" plugin
Loading "security" plugin
Loading "changelog" plugin
Loading "downloadonly" plugin
Setting up and reading Presto delta metadata
No Presto metadata available for fedora
No Presto metadata available for livna
No Presto metadata available for updates
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Error: Cannot find a valid baseurl for repo: fedora


Expected results:
List of packages from local cache.

Additional info:
Comment 1 Stephen 2008-04-07 14:35:28 EDT
yum-fastestmirror should cache it's results such that two back-to-back calls to
yum list do not run the mirror check twice.

yum-fastestmirror should not be invoked at all, even if it's cache is out of
data, if the yum command does not require network access, such as yum info for
an already installed package.

yum-fastestmirror should fail silently when the network is not available. For
example, yum list may decide to check the package list if not done recently, and
this may cause yum-fastestmirror to check the mirrors if not done recently. If
the route to the internet for the local network is down, yum list should work
with the  cached list of packages, perhaps with a warning. This means that
yum-fastestmirror must be driven by the underlying yum commands need for network
access -- it cannot simply be invoked unconditionally at yum startup time.

Comment 2 Luke Macken 2008-05-15 10:05:02 EDT
I believe I fixed this issue.

Could you please test by throwing this in /usr/lib/yum-plugins

http://lmacken.fedorapeople.org/fastestmirror.py

Thanks!
Comment 3 Konstantin Zemlyak 2008-05-19 01:21:49 EDT
Tested, fails. Brought down my external network interface, then tried:

# yum -C list yum
Loading "presto" plugin
Loading "fastestmirror" plugin
Loading "security" plugin
Loading "changelog" plugin
Loading "downloadonly" plugin
Setting up and reading Presto delta metadata
No Presto metadata available for fedora
No Presto metadata available for livna
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Error: Cannot find a valid baseurl for repo: fedora

Disabling all plugins or just fastestmirror works:

# yum -C --noplugins list yum
Installed Packages
yum.noarch                               3.2.8-2.fc8            installed

Moving "if opts.cacheonly" check before "if loadcache" fixes this.
Comment 4 Luke Macken 2008-05-20 11:11:24 EDT
Ah, thanks.  Fixed in 1e5a8cb86f744b6d38156247f16569675c0d6473

http://lmacken.fedorapeople.org/fastestmirror.py updated as well.
Comment 5 Fedora Update System 2008-05-21 08:43:08 EDT
yum-utils-1.1.14-1.fc9 has been submitted as an update for Fedora 9
Comment 6 Fedora Update System 2008-05-21 08:44:57 EDT
yum-utils-1.1.14-1.fc8 has been submitted as an update for Fedora 8
Comment 7 Fedora Update System 2008-05-22 16:37:50 EDT
yum-utils-1.1.14-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-4359
Comment 8 Luke Macken 2008-07-08 13:18:49 EDT
This has been fixed in yum-utils-1.1.14-4.fc9, which is now in the updates
repository.

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