Hide Forgot
Description of problem: <install fresh 6.3> register subscription-manager sudo yum localinstall <somelocalrpm> THE INSTALLED PRODUCT CERT GETS DELETED[1] Why? Because in that scenario, we have no "active" repos (ie, repo's that are enabled and have packages installed) or any "enabled" repo's (ie, enabled in yum repo config) In this case, we end up deleting the installed product cert (we try to delete product certs that are not active) Also, we do not log anywhere that a product cert has been deleted. [1] </sefler>
I have a patch that seems to fix this, and it seems fairly straightforward (well, for being productid.py anyway).
*** Bug 807433 has been marked as a duplicate of this bug. ***
commit 2b349d3120ba24d4021ed7794c28142caf184ecb Author: Adrian Likins <alikins> Date: Fri Mar 23 16:27:19 2012 -0400 806457: Fix deletion of productids with yum localinstall If we encounted a scenario where no repo's were considered "enabled" and no "active" repos, we would delete the productid. A fresh install running a "yum localinstall" would trigger it, since no repo's have been enabled. Check to verify we are not in this scenario before deleting productid's. Also, add some logging describe which productids are being deleted. Previously we had no longer for this.
Before verifying a fixed subscription-manager, I want to demonstrate a failing subscription-manager.... Installed version of subscription-manager that fails: [root@jsefler-r63-workstation ~]# rpm -q subscription-manager subscription-manager-0.99.10-1.el6.x86_64 Steps to reproduce: [root@jsefler-r63-workstation ~]# subscription-manager register --username qa Password: The system has been registered with id: dbdeaf1e-4389-4ee9-a0e9-499707ea1d53 [root@jsefler-r63-workstation ~]# yum repolist Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. repolist: 0 [root@jsefler-r63-workstation ~]# cat /var/lib/rhsm/productid.js { "71":"anaconda-RedHatEnterpriseLinux.x86_64" } [root@jsefler-r63-workstation ~]# ls /etc/pki/product/ 71.pem [root@jsefler-r63-workstation ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Workstation Version: 6.3 Beta Arch: x86_64 Status: Not Subscribed Starts: None Expires: None [root@jsefler-r63-workstation ~]# ^^^ WE ARE CLEANLY REGISTERED AND HAVE AN INSTALLED PRODUCT CERT FOR RHEL [root@jsefler-r63-workstation ~]# wget -q http://download.devel.redhat.com/brewroot/packages/zsh/4.3.10/5.el6/x86_64/zsh-4.3.10-5.el6.x86_64.rpm [root@jsefler-r63-workstation ~]# yum -q -y localinstall zsh-4.3.10-5.el6.x86_64.rpm Warning: RPMDB altered outside of yum. [root@jsefler-r63-workstation ~]# rpm -q zsh zsh-4.3.10-5.el6.x86_64 [root@jsefler-r63-workstation ~]# ^^^ WE HAVE RUN A LOCAL INSTALL OF AN RPM WITHOUT HAVING ANY ACTIVE REPOS [root@jsefler-r63-workstation ~]# cat /var/lib/rhsm/productid.js {} [root@jsefler-r63-workstation ~]# ls /etc/pki/product/ [root@jsefler-r63-workstation ~]# subscription-manager list --installed No installed products to list [root@jsefler-r63-workstation ~]# ^^^ OUR RHEL PRODUCT CERT (71.pem) IS GONE. THAT'S THE BUG.
Verifying Version.... [root@jsefler-r63-workstation ~]# rpm -q subscription-manager subscription-manager-0.99.13-1.el6.x86_64 [root@jsefler-r63-workstation ~]# subscription-manager register --username qa Password: The system has been registered with id: 18c1ad10-831a-45bf-bfff-08f361902b39 [root@jsefler-r63-workstation ~]# yum repolist Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. repolist: 0 [root@jsefler-r63-workstation ~]# cat /var/lib/rhsm/productid.js { "71":"anaconda-RedHatEnterpriseLinux.x86_64" } [root@jsefler-r63-workstation ~]# ls /etc/pki/product/ 71.pem [root@jsefler-r63-workstation ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Workstation Product ID: 71 Version: 6.3 Beta Arch: x86_64 Status: Not Subscribed Starts: Expires: [root@jsefler-r63-workstation ~]# rpm -q zsh package zsh is not installed [root@jsefler-r63-workstation ~]# wget -q http://download.devel.redhat.com/brewroot/packages/zsh/4.3.10/5.el6/x86_64/zsh-4.3.10-5.el6.x86_64.rpm [root@jsefler-r63-workstation ~]# yum -q -y localinstall zsh-4.3.10-5.el6.x86_64.rpm Warning: RPMDB altered outside of yum. [root@jsefler-r63-workstation ~]# rpm -q zsh zsh-4.3.10-5.el6.x86_64 ^^^ A YUM LOCAL INSTALL OF ZSH WAS SUCCESSFUL AS EXPECTED [root@jsefler-r63-workstation ~]# cat /var/lib/rhsm/productid.js { "71":"anaconda-RedHatEnterpriseLinux.x86_64" } [root@jsefler-r63-workstation ~]# ls /etc/pki/product/ 71.pem [root@jsefler-r63-workstation ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Workstation Product ID: 71 Version: 6.3 Beta Arch: x86_64 Status: Not Subscribed Starts: Expires: ^^^ WITHOUT ANY ENABLED REPOS, THE YUM LOCAL INSTALL OF A PACKAGE DID NOT REMOVE OUR INSTALLED PRODUCT CERT (71.pem). FIX VERIFIED! [root@jsefler-r63-workstation ~]# yum -q -y remove zsh [root@jsefler-r63-workstation ~]# rpm -q zsh package zsh is not installed [root@jsefler-r63-workstation ~]# cat /var/lib/rhsm/productid.js { "71":"anaconda-RedHatEnterpriseLinux.x86_64" } [root@jsefler-r63-workstation ~]# ls /etc/pki/product/ 71.pem [root@jsefler-r63-workstation ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Workstation Product ID: 71 Version: 6.3 Beta Arch: x86_64 Status: Not Subscribed Starts: Expires: [root@jsefler-r63-workstation ~]# ^^^ EVEN AFTER YUM REMOVING THE PACKAGE, THE PRODUCT CERT REMAINS INSTALLED. Moving to VERIFIED