Bug 806457
Summary: | If yum runs with no enabled or active repo's, we delete the product cert | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Adrian Likins <alikins> | |
Component: | subscription-manager | Assignee: | Adrian Likins <alikins> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Entitlement Bugs <entitlement-bugs> | |
Severity: | urgent | Docs Contact: | ||
Priority: | high | |||
Version: | 6.3 | CC: | bkearney, cduryee, cww, dgregor, jlaska, jmolet, jsefler, syeghiay, whayutin | |
Target Milestone: | rc | Keywords: | ZStream | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 807669 812043 812051 (view as bug list) | Environment: | ||
Last Closed: | 2012-05-30 13:14: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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 738066, 807669, 808232, 812043, 812051, 812446 |
Description
Adrian Likins
2012-03-23 19:43:21 UTC
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 |