Bug 769864 - 'yum makecache' exits on unreachable repo with 'skip_if_unavailabe=1' set
'yum makecache' exits on unreachable repo with 'skip_if_unavailabe=1' set
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
6.2
Unspecified Unspecified
medium Severity medium
: alpha
: 6.3
Assigned To: James Antill
BaseOS QE Security Team
:
Depends On:
Blocks: 845581
  Show dependency treegraph
 
Reported: 2011-12-22 10:14 EST by David Jaša
Modified: 2014-01-21 01:24 EST (History)
2 users (show)

See Also:
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 09:53:50 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 David Jaša 2011-12-22 10:14:10 EST
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 07:19:39 EST
> 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 07:35:40 EST
(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 08:02:35 EDT
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 03:56:18 EDT
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 11:48:37 EDT
Yeh, seems fine  to me ... you told it to skip on errors, and it skipped. Success.
Comment 13 errata-xmlrpc 2012-06-20 09:53:50 EDT
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

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