Bug 769864

Summary: 'yum makecache' exits on unreachable repo with 'skip_if_unavailabe=1' set
Product: Red Hat Enterprise Linux 6 Reporter: David Jaša <djasa>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: ksrot, zpavlas
Target Milestone: alpha   
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 819537 828658 845581 (view as bug list) Environment:
Last Closed: 2012-06-20 13:53:50 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: 845581    

Description David Jaša 2011-12-22 15:14:10 UTC
Description of problem:
SSIA. 'yum update' does not have this problem, unreachable repos with skip_if_unavailable=1 are skipped

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

How reproducible:
always

Steps to Reproduce:
1. set up a repo:
[test]
name=test
baseurl=<url that is valid but returns 404>
enabled=1
skip_if_unavailable=1
2. run yum --disablerepo='*' --enablerepo test makecache
3.
  
Actual results:
yum exits complaining that it can not download info for test repo:
$BASEURL: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: test. Please verify its path and try again

Expected results:
yum skips repo

Additional info:

Comment 1 Zdeněk Pavlas 2012-01-12 12:19:39 UTC
> Expected results: yum skips repo

You have enabled only one repo, and Yum did skip that.  'skip_if_unavailable=1' does not prevent Yum from printing error messages (that's intended).

Could you try '--enablerepo test --enablerepo other' too?  This works upstream, but I don't have RHEL6 at hands.  Thanks!

Comment 2 David Jaša 2012-01-12 12:35:40 UTC
(In reply to comment #1)
> > Expected results: yum skips repo
> 
> You have enabled only one repo, and Yum did skip that.  'skip_if_unavailable=1'
> does not prevent Yum from printing error messages (that's intended).
> 

This exactly does not work in RHEL:

# yum makecache ; echo $?
Loaded plugins: auto-update-debuginfo, refresh-packagekit, rhnplugin
[other repo metadata fetched]     
<repo_URL>: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: <repo>. Please verify its path and try again
1

yum should ignore the error and keep going through the rest of the repos, it exits with 1 instead.

Comment 6 Karel Srot 2012-04-03 12:02:35 UTC
The bug is not fixed in yum-3.2.29-27.el6.noarch

# yum --disablerepo='*' --enablerepo=bz769864repo\* makecache
Loaded plugins: downloadonly, local, presto, product-id, refresh-packagekit, rhnplugin, security,
              : subscription-manager
Updating certificate-based repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
http://redhat.com/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: bz769864repoA. Please verify its path and try again
#


yum crashes already at

    def doCommand(self, base, basecmd, extcmds):
            ...
            ...
            for repo in base.repos.listEnabled():
>>HERE<<        repo.repoXML

from /usr/share/yum-cli/yumcommands.py.

Comment 9 Karel Srot 2012-04-10 07:56:18 UTC
yum-3.2.29-28.el6.noarch

:: [   FAIL   ] :: Running 'yum --disablerepo='*' --enablerepo=bz769864repo\* makecache' (Expected 1, got 0)
Loaded plugins: downloadonly, presto, product-id, refresh-packagekit, rhnplugin,
              : security, subscription-manager
Updating certificate-based repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
http://redhat.com/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Metadata Cache Created
http://redhat.com/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"

Just want to make sure whether it is OK for yum makecache to exit with 0 when the skip_if_unavailable repo is not available. From my point of view it is fine since the repo is expected to be unavailable sometimes, therefore I don't see a reason why yum should fail. Please confirm.

Comment 11 James Antill 2012-04-16 15:48:37 UTC
Yeh, seems fine  to me ... you told it to skip on errors, and it skipped. Success.

Comment 13 errata-xmlrpc 2012-06-20 13:53:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0857.html