RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 806457 - If yum runs with no enabled or active repo's, we delete the product cert
Summary: If yum runs with no enabled or active repo's, we delete the product cert
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.3
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: Entitlement Bugs
URL:
Whiteboard:
: 807433 (view as bug list)
Depends On:
Blocks: 738066 807669 808232 812043 812051 812446
TreeView+ depends on / blocked
 
Reported: 2012-03-23 19:43 UTC by Adrian Likins
Modified: 2012-05-30 13:14 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 807669 812043 812051 (view as bug list)
Environment:
Last Closed: 2012-05-30 13:14:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0804 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2012-06-19 19:51:31 UTC

Description Adrian Likins 2012-03-23 19:43:21 UTC
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>

Comment 2 Adrian Likins 2012-03-23 20:16:47 UTC
I have a patch that seems to fix this, and it seems fairly straightforward (well, for being productid.py anyway).

Comment 3 wes hayutin 2012-03-27 19:45:23 UTC
*** Bug 807433 has been marked as a duplicate of this bug. ***

Comment 4 Adrian Likins 2012-03-29 20:36:53 UTC
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.

Comment 7 John Sefler 2012-04-09 21:32:28 UTC
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.

Comment 8 John Sefler 2012-04-09 21:51:07 UTC
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


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