Bug 755077

Summary: 404 error on any repo results in yum failure
Product: Red Hat Enterprise Linux 6 Reporter: Matthew Mosesohn <mmosesoh>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED UPSTREAM QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: msanders, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-18 20:06:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 670971    

Description Matthew Mosesohn 2011-11-18 18:50:49 UTC
Description of problem:
If you have 1 repo enabled that points to a repo that no longer exists, you can't run any yum install or update.

Version-Release number of selected component (if applicable):
yum-3.2.29-22.el6

How reproducible:
Always

Steps to Reproduce:
1. Create a repo that points to an invalid URL that will return a 404 error
2. yum update
  
Actual results:
[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"


Expected results:
The repo that has a 404 error should be skipped and attempt to try to continue and attempt the operation based on the remaining repos that work.

Additional info:
This will cause package installs triggered by RHN or Satellite to fail if there is any repo that points to a 404 URL

Comment 3 James Antill 2011-11-18 20:06:22 UTC
 This is intentional, in that the policy is it's better to do nothing than do the wrong thing.

 If this kind of thing is likely with particular repos. though, in RHEL-6 you can specify "skip_if_unavailable=true" in the .repo file ... and that repo. will be automatically disabled.

Comment 4 Matthew Mosesohn 2011-11-18 20:14:30 UTC
James,

There is no global option you can specify in yum.conf which can set this globally.  It's important to provide a mechanism to ensure that Satellite can install packages on a system, regardless of the less-than-intelligent sysadmin who happens to have root on the host.  If someone goes and finds a random repo for their favorite software, and then the tree where that repo disappears, there's little the Satellite admin can do to install or update packages on the host.

What is the main reason behind preventing the creation of a global skip_if_unavailable option?  It would really add a lot of value to yum.

Comment 5 James Antill 2012-02-02 16:00:49 UTC
 There are lots of things a user can do which will break yum, or RHN. They can also do things like enable a repo. that obsoletes something which breaks RHN repos. ... or even just has bad deps. (so "yum upgrade" fails, even though the repo. is "working").

 From the Satellite/RHN side one workaround that users might like is a mode where you try to do the operation but with _only_ RHN repos. enabled (or even, only some of them).

 From the yum side, the skip option is basically a hacky getout to say "this repo. is kind of worthless, I don't mind if it randomly goes away" ... saying that for all the repos. by default would be _very_ strange.

Comment 7 seth vidal 2012-02-02 21:02:16 UTC
Hi,
 I sent a patch to yum upstream which handles this case, I think

you should be able to do:

yum --setopt='*.skip_if_unavailable=1' update

and it will make all repos have that value for run time.

or

yum-config-manager --setopt='*.skip_if_unavailable=1' --save

and it will save that setting to all repos defined for that system.


It's a pretty non-invasive patch and it shouldn't break anyone else's cases since it's not like a repo can be named with globs anyway.