Bug 1403015

Summary: yum does not obey [repo].skip_if_unavailable=true
Product: Red Hat Enterprise Linux 7 Reporter: Joe Wright <jwright>
Component: yum-utilsAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: emrakova, james.antill, jcastran, jwright, mdomonko, packaging-team-maint, vmukhame
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: yum-utils-1.1.31-41.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 12:27:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1393866    
Attachments:
Description Flags
log collected using script none

Description Joe Wright 2016-12-08 21:48:32 UTC
Created attachment 1229658 [details]
log collected using script

Description of problem:
- yum commands fail if repo is unavailable when repo is set to skip if unavailable


Version-Release number of selected component (if applicable):
yum-utils-1.1.31-40.el7.noarch
yum-3.4.3-150.el7.noarch
yum-langpacks-0.4.2-7.el7.noarch
yum-rhn-plugin-2.0.1-6.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
PackageKit-yum-1.0.7-6.el7.x86_64

How reproducible:


Steps to Reproduce:
1. Run command: yum-config-manager --save --setopt=rhel-7-server-openstack-10-tools-debug-rpms.skip_if_unavailable=true (or use whatever repo you want)
2. Run something like: 

3. If repo cannot be contacted, command will fail with a 404 error

Actual results:
- failure to contact cancelled repo causes command to fail

Expected results:


Additional info:
See attached log file yum.error

Comment 1 Joe Wright 2016-12-08 21:56:54 UTC
Passing --setopt=*.skip_if_unavailable=true to the actual yum command appears to work, however setting in yum.conf or using yum-config-manager does not work.

Comment 2 Joe Wright 2016-12-08 22:02:27 UTC
Corrected reproduce steps:

Steps to Reproduce:
1. Run command: yum-config-manager --save --setopt=rhel-7-server-openstack-10-tools-debug-rpms.skip_if_unavailable=true (or use whatever repo you want)
2. Run something like: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/c8/04823bc571a3a9bf79be0e341048db167eae6b 

3. If any one repo cannot be contacted, command will fail with a 404 error, despite if a blanket *.skip_if_unavailable=true or that specific repo is set to skip if unavailable.

Comment 5 Karel Srot 2017-01-04 08:03:25 UTC
Hi Joe,
could you please confirm that you have the repo "rhel-7-server-openstack-10-tools-debug-rpms" configured in /etc/yum.repos.d/? Because it seem not to be listed in your yum-config-manager output.

Comment 6 Karel Srot 2017-01-04 08:09:07 UTC
Seem to be duplicate of bug 1369682

Comment 7 Valentina Mukhamedzhanova 2017-01-04 11:39:21 UTC
(In reply to Joe Wright from comment #2)
> 1. Run command: yum-config-manager --save
> --setopt=rhel-7-server-openstack-10-tools-debug-rpms.
> skip_if_unavailable=true (or use whatever repo you want)

Unless a specific repo is explicitly provided to yum-config-manager, it only affects the enabled repos. In the described scenario the repo is disabled, so you have to provide it explicitly. In other words, the way you're currently supposed to run the command in order to achieve the desired effect is like this:

# yum-config-manager --save --setopt=rhel-7-server-openstack-10-tools-debug-rpms.skip_if_unavailable=true rhel-7-server-openstack-10-tools-debug-rpms

The reason for this behaviour is that users usually have *a lot* of disabled repos (and often they don't even realise it), and matching them all will only spam and confuse the user.

That being said, I agree that this is a usability issue and the documentation does not explain the behaviour properly. The way we can improve this is we can go through --setopt's and see if they specify a repo explicitly and act upon that repo even if it is disabled. I would still keep the old behaviour for setopt's with globbing expressions. The documentation can also be improved.

I am removing the Regression keyword, as to my knowledge this is not a regression, it has always worked this way.

> Passing --setopt=*.skip_if_unavailable=true to the actual yum command appears
> to work, however setting in yum.conf or using yum-config-manager does not work.

skip_if_unavailable is a per repository option, so setting it in yum.conf (that is, in the [main] section) will not have any effect.

Comment 15 errata-xmlrpc 2017-08-01 12:27:31 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.

https://access.redhat.com/errata/RHBA-2017:2067