Bug 812446 - If yum runs with no enabled or active repo's, we delete the product cert
If yum runs with no enabled or active repo's, we delete the product cert
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.3
Unspecified Unspecified
high Severity urgent
: rc
: ---
Assigned To: Bryan Kearney
Entitlement Bugs
: ZStream
Depends On: 806457
Blocks: 738066
  Show dependency treegraph
 
Reported: 2012-04-13 14:42 EDT by RHEL Product and Program Management
Modified: 2012-05-10 02:38 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-10 02:38:18 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 RHEL Product and Program Management 2012-04-13 14:42:00 EDT
This bug has been copied from bug #806457 and has been proposed
to be backported to 6.2 z-stream (EUS).
Comment 4 Alex Wood 2012-04-18 13:48:27 EDT
Committed d4983e05bc98c05da7cd1a95f85987c5fc85da36 to RHEL6.2 branch
Comment 6 John Sefler 2012-04-25 15:53:05 EDT
Demonstrating the error on a current RHEL62 system before applying fix...

[root@rhsm-compat-rhel62 ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64


Fetching an rpm that we will use for testing purposes and backing up some files that I already know will be destroyed as a consequence of this bug...
[root@rhsm-compat-rhel62 ~]# wget -q -O /tmp/zsh.rpm http://download.devel.redhat.com/brewroot/packages/zsh/4.3.10/4.1.el6/x86_64/zsh-4.3.10-4.1.el6.x86_64.rpm
[root@rhsm-compat-rhel62 ~]# cp /etc/pki/product/69.pem /tmp
[root@rhsm-compat-rhel62 ~]# cp /var/lib/rhsm/productid.js /tmp
[root@rhsm-compat-rhel62 ~]# 

[root@rhsm-compat-rhel62 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Red Hat Enterprise Linux Server
Version:            	6.2                      
Arch:               	x86_64                   
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@rhsm-compat-rhel62 ~]# cat /var/lib/rhsm/productid.js
{
  "69":"anaconda-RedHatEnterpriseLinux.x86_64"
}
[root@rhsm-compat-rhel62 ~]# 

^^^ PRODUCT ID 69 IS INSTALLED AND LIFE IS GOOD
    NOW LET'S YUM INSTALL A LOCAL PACKAGE


[root@rhsm-compat-rhel62 ~]# yum repolist
Loaded plugins: 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.
repolist: 0
[root@rhsm-compat-rhel62 ~]# yum -q -y localinstall /tmp/zsh.rpm 
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Warning: RPMDB altered outside of yum.
[root@rhsm-compat-rhel62 ~]# rpm -q zsh
zsh-4.3.10-4.1.el6.x86_64
[root@rhsm-compat-rhel62 ~]# 

^^^ AN RPM HAS BEEN LOCALLY INSTALLED WHILE NO REPOS ARE ACTIVE repolist:0
    THE CONSEQUENCE IS...


[root@rhsm-compat-rhel62 ~]# subscription-manager list --installed
No installed Products to list
[root@rhsm-compat-rhel62 ~]# cat /var/lib/rhsm/productid.js
{}[root@rhsm-compat-rhel62 ~]# 

^^^ THE INSTALLED PRODUCT ID 69 HAS BEEN DELETED!  THAT'S BAD.



Restoring backed-up files before applying the fix..
[root@rhsm-compat-rhel62 ~]# cp /tmp/productid.js /var/lib/rhsm
cp: overwrite `/var/lib/rhsm/productid.js'? y
[root@rhsm-compat-rhel62 ~]# cp /tmp/69.pem /etc/pki/product/
[root@rhsm-compat-rhel62 ~]#
Comment 7 John Sefler 2012-04-25 16:17:27 EDT
Applying the new subscription-manager and demonstrating the fix...

[root@rhsm-compat-rhel62 ~]# rpm -U http://download.devel.redhat.com/brewroot/packages/subscription-manager/0.96.18/1.el6_2/x86_64/subscription-manager-0.96.18-1.el6_2.x86_64.rpm
[root@rhsm-compat-rhel62 ~]# rpm -q subscription-manager
subscription-manager-0.96.18-1.el6_2.x86_64
[root@rhsm-compat-rhel62 ~]# 


[root@rhsm-compat-rhel62 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Red Hat Enterprise Linux Server
Version:            	6.2                      
Arch:               	x86_64                   
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@rhsm-compat-rhel62 ~]# cat /var/lib/rhsm/productid.js
{
  "69":"anaconda-RedHatEnterpriseLinux.x86_64"
}
[root@rhsm-compat-rhel62 ~]# 

^^^ PRODUCT ID 69 IS INSTALLED AND LIFE IS GOOD
    NOW LET'S YUM INSTALL A LOCAL PACKAGE


[root@rhsm-compat-rhel62 ~]# yum repolist
Loaded plugins: 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.
repolist: 0
[root@rhsm-compat-rhel62 ~]# rpm -e zsh
[root@rhsm-compat-rhel62 ~]# yum -q -y localinstall /tmp/zsh.rpm
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Warning: RPMDB altered outside of yum.
[root@rhsm-compat-rhel62 ~]# rpm -q zsh
zsh-4.3.10-4.1.el6.x86_64
[root@rhsm-compat-rhel62 ~]# 

^^^ AN RPM HAS BEEN LOCALLY INSTALLED WHILE NO REPOS ARE ACTIVE repolist:0
    LET'S VERIFY THE INSTALLED PRODUCT REMAINS...


[root@rhsm-compat-rhel62 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Red Hat Enterprise Linux Server
Version:            	6.2                      
Arch:               	x86_64                   
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@rhsm-compat-rhel62 ~]# cat /var/lib/rhsm/productid.js
{
  "69":"anaconda-RedHatEnterpriseLinux.x86_64"
}
[root@rhsm-compat-rhel62 ~]# 

^^^ YES.  THE INSTALLED PRODUCT REMAINS INSTALLED.  BUG FIX IS VERIFIED!
Comment 8 John Sefler 2012-04-26 12:55:10 EDT
Also confirmed that the failure in comment 6 occurs on s390x with...
[root@ibm-z10-29 ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.s390x

And VERIFIED that the fix in comment 7 occurs occurs on s390x with...
[root@ibm-z10-29 ~]# rpm -q subscription-manager
subscription-manager-0.96.18-1.el6_2.s390x
Comment 9 errata-xmlrpc 2012-05-10 02:38:18 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-0562.html

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