RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1029359 - yum grouplist ignores skip_if_unavailable=1
Summary: yum grouplist ignores skip_if_unavailable=1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks: 1028455
TreeView+ depends on / blocked
 
Reported: 2013-11-12 09:17 UTC by Alon Bar-Lev
Modified: 2014-10-14 04:37 UTC (History)
7 users (show)

Fixed In Version: yum-3.2.29-55.el6
Doc Type: Bug Fix
Doc Text:
Cause: have an unavailable repo with 'skip_if_unavailabe=1' and run 'yum grouplist' Consequence: yum sees an unavailable repo and exits Fix: patch Result: the unavailable repo with 'skip_if_unavailabe=1' is skipped and 'yum grouplist' works as expected
Clone Of:
Environment:
Last Closed: 2014-10-14 04:37:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1410 0 normal SHIPPED_LIVE yum bug fix update 2014-10-14 00:54:51 UTC

Description Alon Bar-Lev 2013-11-12 09:17:54 UTC
Description of problem:

yum grouplist does not respect skip_if_unavailable=1 repository property, and fails when repository is unavailable.

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

How reproducible:
Always.

Steps to Reproduce:
1. /etc/yum.repos.d/foobar.repo
---
[foobar]
name=foobar
baseurl=http://foobar
gpgcheck=0
enabled=1
skip_if_unavailable=1
---

2. yum clean expire-cache

3. yum grouplist

Actual results:

# yum grouplist

Loaded plugins: priorities, product-id, refresh-packagekit, rhnplugin, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Group Process
epel/metalink                                                                                                                                                          |  15 kB     00:00     
http://foobar/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'foobar'"
Trying other mirror.
http://foobar/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'foobar'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: foobar. Please verify its path and try again


Expected results:

Success even if foobar repo is unreachable.

# yum grouplist
Loaded plugins: priorities, product-id, refresh-packagekit, rhnplugin, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Group Process
is                                                                                                                                                                     | 1.3 kB     00:00     
rhel                                                                                                                                                                   | 4.0 kB     00:00     
rhel-x86_64-server-6                                                                                                                                                   | 1.8 kB     00:00     
sf                                                                                                                                                                     | 1.9 kB     00:00     
file:///root/alonbl/ovirt-engine-rhevm/output/3.3.0-0.101.20131019gitf41c0ae.root/repodata/repomd.xml: [Errno 14] Could not open/read file:///root/alonbl/ovirt-engine-rhevm/output/3.3.0-0.101.20131019gitf41c0ae.root/repodata/repomd.xml
Trying other mirror.
Installed Groups:
   Additional Development
   Base
   Client management tools
<snip>
   Zulu Support [zu]
Done

Comment 2 Zdeněk Pavlas 2013-11-12 09:43:08 UTC
Reproduced the bug.  It's fixed upstream, as a side effect of the following 1-line commit.  Backporting fixed the bug in my reproducer.

commit 83b1afba634f361fefc7d9eef53133c501e58aeb
Author: James Antill <james>
Date:   Tue Jun 28 15:59:22 2011 -0400

     Don't call repo.doSetup() if we've already setup the repos. BZ 717163.
    
     Test: yum in @core == has    setup.
           yum rm @core == hasn't setup.

diff --git a/yum/__init__.py b/yum/__init__.py
index 92f25d4..2dce3bf 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -792,7 +792,9 @@ class YumBase(depsolve.Depsolve):
         self.verbose_logger.log(logginglevels.DEBUG_4,
                                 _('Getting group metadata'))
         reposWithGroups = []
-        self.repos.doSetup()
+        #  Need to make sure the groups data is ready to read. Really we'd want
+        # to add groups to the mdpolicy list of the repo. but we don't atm.
+        self.pkgSack
         for repo in self.repos.listGroupsEnabled():
             if repo.groups_added: # already added the groups from this repo

Comment 3 Alon Bar-Lev 2013-11-12 09:49:46 UTC
Thanks for quick response!

Comment 10 Karel Srot 2014-07-01 09:56:14 UTC
VERIFIED
tested with /CoreOS/yum/Regression/bz1029359-yum-grouplist-ignores-skip_if_unavailable

yum-3.2.29-59.el6.noarch:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'yum --disablerepo=\* --enablerepo=bz1029359repo\* --noplugins grouplist &> log' (Expected 0, got 0)
:: [   PASS   ] :: File 'log' should contain 'test-group-a' 
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 2 good, 0 bad
:: [   PASS   ] :: RESULT: Test

yum-3.2.29-43.el6_5.noarch:


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   FAIL   ] :: Running 'yum --disablerepo=\* --enablerepo=bz1029359repo\* --noplugins grouplist &> log' (Expected 0, got 1)
Setting up Group Process
http://127.0.0.9/nosuchrepo/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
http://127.0.0.9/nosuchrepo/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: bz1029359repoA. Please verify its path and try again
:: [   FAIL   ] :: File 'log' should contain 'test-group-a' 
'52b322ff-dc77-4d7b-b718-d1802a05a93d'
Test result: FAIL

Comment 12 errata-xmlrpc 2014-10-14 04:37:04 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-2014-1410.html


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