Bug 735339

Summary: The rhnplugin.repos file is not wiped when system channels are unassigned
Product: Red Hat Enterprise Linux 6 Reporter: Šimon Lukašík <slukasik>
Component: yum-rhn-pluginAssignee: Michael Mráka <mmraka>
Status: CLOSED ERRATA QA Contact: Jiří Mikulka <jmikulka>
Severity: medium Docs Contact:
Priority: low    
Version: 6.2CC: jmikulka, mmraka, msuchy
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-rhn-plugin-0.9.1-38.el6 rhn-client-tools-1.0.0-76.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 11:59:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Šimon Lukašík 2011-09-02 12:12:59 UTC
Description of problem:
When the yum-rhn-plugin within the 'yum repolist' command discovers
that there is no channel available within RHN, it emits warning message:

    This system is not subscribed to any channels.

However the yum-rhn-plugin omits to wipe the rhnplugin.repos file.
This might cause some random failures. One of the know is that
the subsequent 'yum clean all' command attempts to delete repository
metadata for RHN channels, even if they are not assigned to the
system.

The only workaround is to remove rhnplugin.repos manually.

Version-Release number of selected component (if applicable):
yum-3.2.29-17.el6.noarch
yum-rhn-plugin-0.9.1-35.el6.noarch


How reproducible:
Deterministic

Steps to Reproduce:
1. Register system to RHN Satellite to rhel base channel
2. yum repolist
3. Unassign the base channel on RHN Satellite webui
4. yum repolist
5. yum clean all

Actual results: (Step 4 and 5)
# yum repolist
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
repo id                         repo name                                                            status
beaker                          Beaker                                                                  13
rhel-x86_64-server-6            Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)             5,423
repolist: 5,436
# yum clean all
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
Cleaning repos: beaker rhel-x86_64-server-6
Cleaning up Everything

Expected results:

Additional info:

Comment 1 Šimon Lukašík 2011-09-02 12:20:46 UTC
The problem is also present when the system is deleted from RHN Satellite,


# yum repolist
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.

Error Message:
	Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation: 
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

beaker                                                                              | 2.9 kB     00:00     
beaker/primary_db                                                                   | 7.7 kB     00:00     
repo id                                            repo name                                         status
beaker                                             Beaker                                            13
repolist: 13
# yum clean all
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
Cleaning repos: beaker rhel-x86_64-server-6
Cleaning up Everything

Comment 2 Šimon Lukašík 2011-09-02 12:23:30 UTC
The problem is also exposed after removal of the systemid file.


# yum repolist
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
repo id                                            repo name                                         status
beaker                                             Beaker                                            13
repolist: 13
# yum clean all
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
Cleaning repos: beaker rhel-x86_64-server-6
Cleaning up Everything

Comment 3 Michael Mráka 2011-09-13 11:58:37 UTC
FIxed in spacewalk master by
commit 570e37f07945c0208ec6a5c69a39be7ea34d74f1
    735339 - truncate rhnplugin.repos when there are no rhn channels

Comment 4 Šimon Lukašík 2011-09-13 13:12:31 UTC
QA would like to automate, all the three scenarios. See comment 0 - comment 2.

Comment 6 Miroslav Suchý 2012-01-09 13:55:34 UTC
moving back to assigned, this has not been cherrypicked yet.

Comment 7 Michael Mráka 2012-01-12 08:51:07 UTC
Backported to CLIENT-RHEL-6 as
commit c95ae92184e617de01d0e9dfe2f8d59a3cf7be00
    735339 - truncate rhnplugin.repos when there are no rhn channels

Comment 10 errata-xmlrpc 2012-06-20 11:59: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.

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