Bug 701189

Summary: `yum clean all` do not clean repomod.xml of a channel
Product: Red Hat Enterprise Linux 6 Reporter: Jan Hutař <jhutar>
Component: yum-rhn-pluginAssignee: Michael Mráka <mmraka>
Status: CLOSED ERRATA QA Contact: Martin Minar <mminar>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.1CC: mkoci, mminar, mmraka, slukasik, stephan.duehr
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-rhn-plugin-0.9.1-33.el6 Doc Type: Bug Fix
Doc Text:
When building a list of cached channels, the previous version of rhnplugin failed to verify that a cachedir directory exists. This caused this list to be empty, and any subsequent "yum clean" command therefore ignored these channels. This update adapts rhnplugin to create such a directory when necessary so that the list of cached channels can be successfully created.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 16:49:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jan Hutař 2011-05-01 22:50:28 UTC
Description of problem:
`yum clean all` do not remove repomod.xml file of a channel in case cache was filled in a specific way.


Version-Release number of selected component (if applicable):
yum-rhn-plugin-0.9.1-26.el6.noarch
yum-3.2.29-17.el6.noarch
rhnlib-2.5.22-10.el6.noarch
redhat-release-server-6Server-6.1.0.2.el6.x86_64


How reproducible:
always


Steps to Reproduce:
1. # rm -rf /var/cache/yum/*
2. # yum list all >/dev/null
3. # ls /var/cache/yum/x86_64/6Server/beaker-tasks/repomd.xml
4. # ls /var/cache/yum/x86_64/6Server/rhel-x86_64-server-6/repomd.xml
5. # yum clean all
6. # ls /var/cache/yum/x86_64/6Server/beaker-tasks/repomd.xml
7. # ls /var/cache/yum/x86_64/6Server/rhel-x86_64-server-6/repomd.xml


Actual results:
ls commands in 3., 4. and 7. are successful


Expected results:
only ls commands in 3. and 4.


Additional info:
Note: "beaker-tasks" is a common http:// repo, "rhel-x86_64-server-6" is RHN Hosted channel.

Note2: If in step 2. I use `yum upgrade`, `yum clean all` in 5. works as expected (files not found in 6. and 7.)

Comment 2 Šimon Lukašík 2011-07-18 12:32:02 UTC
The cause is that yum list all populates

    /var/cache/yum/x86_64/6Server/rhel-x86_64-server-6/

structure, while it does not creates rhnplugin.repos file.

Comment 3 Michael Mráka 2011-08-02 09:29:27 UTC
The issue has been fixed in spacewalk master by
commit 301b5e92d84c100db9649be36cdae6248857fc94
    701189 - make sure cachedir exists

Comment 4 Michael Mráka 2011-08-02 09:48:00 UTC
Backported to satellite.git/CLIENT-RHEL-6 as
commit d845f23db98d8e30b51c37ffd3d67ded572765a4
    701189 - make sure cachedir exists (cherry picked from commit 301b5e92d84c100db9649b

Comment 7 Michael Mráka 2011-08-10 08:42:05 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
yum-rhn-plugin didn't check whether cache directory exists and silently ignored its non-existence.

This made list of cached channels empty and subsequent yum clean ignored them.

We fixed creation of cached channel list.

Comment 8 Jaromir Hradilek 2011-10-27 16:27:23 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,5 +1 @@
-yum-rhn-plugin didn't check whether cache directory exists and silently ignored its non-existence.
+When building a list of cached channels, the previous version of rhnplugin failed to verify that a cachedir directory exists. This caused this list to be empty, and any subsequent "yum clean" command therefore ignored these channels. This update adapts rhnplugin to create such a directory when necessary so that the list of cached channels can be successfully created.-
-This made list of cached channels empty and subsequent yum clean ignored them.
-
-We fixed creation of cached channel list.

Comment 9 errata-xmlrpc 2011-12-06 16:49:23 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-2011-1664.html