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 1222627 - deletion of JBOSS product certificate is neglected by product-id plugin on running 'yum remove JBOSS-PKG --disablerepo=RHEL-REPO'
Summary: deletion of JBOSS product certificate is neglected by product-id plugin on ru...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.7
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Chris Snyder
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel68
TreeView+ depends on / blocked
 
Reported: 2015-05-18 16:28 UTC by John Sefler
Modified: 2016-05-10 20:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 20:36:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0797 0 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-01-06 16:31:50 UTC

Description John Sefler 2015-05-18 16:28:00 UTC
Description of problem:
This bug is a follow-up to bug 1159163 which has been fixed.  In bug 1159163, a system was entitled to two repos (one was a RHEL repo and one was a JBOSS repo).  After installing a single JBOSS package, the system was correctly configured with two installed product certs (one was 69 for RHEL and the other was 183 for JBOSS).  This was correct.  When the user ran "yum update --disablerepo=JBOSS-REPO",  the JBOSS product cert 183 was inadvertently removed.  That was a bug and is now fixed.  The follow up to that scenario is the purpose of this bug.  The de-installation of the JBOSS product cert is neglected when I run "yum remove JBOSS-PACKAGE --disablerepo=RHEL-REPO".  Since the disablement of RHEL-REPO should have nothing to do with the removal of the only installed JBOSS package.  I expected the JBOSS product cert 183 to be de-installed at the same time as the removal of the JBOSS-PACKAGE.  This is not happening.  The JBOSS product cert remains installed even though there are no JBOSS packages installed.


Note: When removing the only installed JBOSS package...
  "yum remove JBOSS-PACKAGE --disablerepo=RHEL-REPO" => neglects to remove the JBOSS product cert 183, however...
  "yum remove JBOSS-PACKAGE" => successfully removes the JBOSS product cert 183



Version-Release number of selected component (if applicable):
[root@jsefler-os6 ~]# rpm -q subscription-manager
subscription-manager-1.14.6-1.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-os6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com --username=stage_auto_testuser --auto-attach
Password: 
The system has been registered with ID: 34faad47-a44d-4d0b-b503-7ca7cc23d79e 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager list --available | grep "JBoss" -A4
Subscription Name:   Red Hat JBoss Enterprise Application Platform with Management, 16 Core Standard, L3 Support Partner
Provides:            JBoss Enterprise Application Platform
                     JBoss Enterprise Web Server
                     Red Hat Enterprise MRG Messaging
SKU:                 MW0167254
Contract:            
Pool ID:             8a99f9894d2cdc0d014d354610b31572
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager attach --pool=8a99f9894d2cdc0d014d354610b31572
Successfully attached a subscription for: Red Hat JBoss Enterprise Application Platform with Management, 16 Core Standard, L3 Support Partner
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager repos --enable jb-eap-6-for-rhel-6-server-rpms
Repository 'jb-eap-6-for-rhel-6-server-rpms' is enabled for this system.
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-6-server-rpms
Repo Name: Red Hat Enterprise Linux 6 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/o
           s
Enabled:   1

Repo ID:   jb-eap-6-for-rhel-6-server-rpms
Repo Name: JBoss Enterprise Application Platform 6 (RHEL 6 Server) (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/j
           beap/6/os
Enabled:   1

[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# yum -y -q install jline-eap6 zsh
[root@jsefler-os6 ~]# yumdb get from_repo jline-eap6 zsh
Loaded plugins: product-id, refresh-packagekit
jline-eap6-0.9.94-10.GA_redhat_2.ep6.el6.4.noarch
     from_repo = jb-eap-6-for-rhel-6-server-rpms
zsh-4.3.10-9.el6.x86_64
     from_repo = rhel-6-server-rpms
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# cat /var/lib/rhsm/productid.js 
{
  "69": [
    "rhel-x86_64-server-6", 
    "released-RHEL66", 
    "latest-RHEL6", 
    "rhel-6-server-rpms"
  ], 
  "183": [
    "jb-eap-6-for-rhel-6-server-rpms"
  ]
}[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager list --installed

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.7 Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/01/2015
Ends:           04/30/2016

Product Name:   JBoss Enterprise Application Platform
Product ID:     183
Version:        6.0
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/08/2015
Ends:           05/07/2016

[root@jsefler-os6 ~]# 

At this point we have successfully subscribed to both RHEL and JBOSS content.
We have yum installed a single JBOSS package which caused the placement of the JBOSS product cert 183.
The /var/lib/rhsm/productid.js file correctly reflects the repo from which content for the installed product cert 183 originated.  Now let's attempt to remove the only installed JBOSS package which should also remove the JBOSS product cert.  THE KEY TO THIS ATTEMPT IS THE yum ARGUMENT --disablerepo=rhel-6-server-rpms WHICH SHOULD THEORETICALLY HAVE NO EFFECT ON THE JBOSS product/repos...

[root@jsefler-os6 ~]# yum -y -q remove jline-eap6 --disablerepo=rhel-6-server-rpms
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# cat /var/lib/rhsm/productid.js 
{
  "69": [
    "rhel-x86_64-server-6", 
    "released-RHEL66", 
    "latest-RHEL6", 
    "rhel-6-server-rpms"
  ], 
  "183": [
    "jb-eap-6-for-rhel-6-server-rpms"
  ]
}[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager list --installed

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.7 Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/01/2015
Ends:           04/30/2016

Product Name:   JBoss Enterprise Application Platform
Product ID:     183
Version:        6.0
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/08/2015
Ends:           05/07/2016

[root@jsefler-os6 ~]# 

BANG! At this point I expected product cert 183 to have been de-installed.

[root@jsefler-os6 ~]# tail -f /var/log/rhsm/rhsm.log
2015-05-18 12:05:35,933 [DEBUG] yum:29892 @plugins.py:569 - loaded plugin modules: []
2015-05-18 12:05:35,934 [DEBUG] yum:29892 @plugins.py:570 - loaded plugins: {}
2015-05-18 12:05:36,347 [DEBUG] yum:29892 @productid.py:439 - Checking for product id certs to install or update.
2015-05-18 12:05:36,348 [DEBUG] yum:29892 @productid.py:444 - active set([])
2015-05-18 12:05:36,348 [DEBUG] yum:29892 @productid.py:445 - enabled [(<rhsm.certificate2.ProductCertificate object at 0x4235bd0>, 'jb-eap-6-for-rhel-6-server-rpms')]
2015-05-18 12:05:36,348 [DEBUG] yum:29892 @productid.py:461 - product cert: 183 repo: jb-eap-6-for-rhel-6-server-rpms
2015-05-18 12:05:36,349 [DEBUG] yum:29892 @productid.py:579 - about to run post_product_id_install
2015-05-18 12:05:36,349 [DEBUG] yum:29892 @productid.py:590 - about to run post_product_id_update




Additional Info:
Let's demonstrate one more thing.... If I remove a RHEL package using yum without the --disablerepo=rhel-6-server-rpms, then the JBOSS product cert will consequently be de-installed as follows....


[root@jsefler-os6 ~]# yum -y -q remove zsh
[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# cat /var/lib/rhsm/productid.js 
{
  "69": [
    "rhel-x86_64-server-6", 
    "released-RHEL66", 
    "latest-RHEL6", 
    "rhel-6-server-rpms"
  ]
}[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# subscription-manager list --installed

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.7 Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/01/2015
Ends:           04/30/2016

[root@jsefler-os6 ~]# 
[root@jsefler-os6 ~]# tail -f /var/log/rhsm/rhsm.log
2015-05-18 12:16:50,095 [DEBUG] yum:30226 @plugins.py:569 - loaded plugin modules: []
2015-05-18 12:16:50,095 [DEBUG] yum:30226 @plugins.py:570 - loaded plugins: {}
2015-05-18 12:16:51,182 [DEBUG] yum:30226 @productid.py:661 - Checking for product certs to remove. Active include: set(['rhel-6-server-rpms'])
2015-05-18 12:16:51,185 [DEBUG] yum:30226 @productid.py:707 - rhel-6-server-rpms is an active repo. Not deleting product cert 69
2015-05-18 12:16:51,185 [INFO] yum:30226 @productid.py:728 - None of the repos for 183 are active: ['jb-eap-6-for-rhel-6-server-rpms']
2015-05-18 12:16:51,185 [INFO] yum:30226 @productid.py:729 - product cert 183 for 183 is being deleted
2015-05-18 12:16:51,185 [DEBUG] yum:30226 @productid.py:439 - Checking for product id certs to install or update.
2015-05-18 12:16:51,186 [DEBUG] yum:30226 @productid.py:444 - active set(['rhel-6-server-rpms'])
2015-05-18 12:16:51,186 [DEBUG] yum:30226 @productid.py:445 - enabled [(<rhsm.certificate2.ProductCertificate object at 0x16d5110>, 'jb-eap-6-for-rhel-6-server-rpms'), (<rhsm.certificate2.ProductCertificate object at 0x16d5150>, 'rhel-6-server-rpms')]
2015-05-18 12:16:51,186 [DEBUG] yum:30226 @productid.py:461 - product cert: 183 repo: jb-eap-6-for-rhel-6-server-rpms
2015-05-18 12:16:51,186 [DEBUG] yum:30226 @productid.py:461 - product cert: 69 repo: rhel-6-server-rpms
2015-05-18 12:16:51,187 [DEBUG] yum:30226 @productid.py:523 - Latest version of product cert for Red Hat Enterprise Linux Server 6.6 is already install, not updating
2015-05-18 12:16:51,187 [DEBUG] yum:30226 @productid.py:579 - about to run post_product_id_install
2015-05-18 12:16:51,187 [DEBUG] yum:30226 @productid.py:590 - about to run post_product_id_update




Suspicion is that the empty active set([]) in the rhsm.log is preventing the removal check on 183.

Comment 2 Chris Snyder 2015-12-18 21:53:13 UTC
I have a reproducer for this in it's entirety. The difficulty in reproducing this came in that the packages 'httpd' and 'httpd-tools' are provided by the 'jb-eap-6-for-rhel-6-server-rpms' repo. I'm unsure if this has changed since the bug was filed but either way, after removing those packages following the above steps to reproduce works.

Comment 3 Chris Snyder 2015-12-22 21:39:16 UTC
PR here: https://github.com/candlepin/subscription-manager/pull/1361

Comment 4 Chris Snyder 2015-12-23 16:58:51 UTC
In upstream master as of the commit below. This should be in the next build of subman in the new year as such moving to modified.

commit 5cbdfa6987238e184a3257132af73e91a62d4963
Author: Christopher Snyder <csnyder>
Date:   Tue Dec 22 16:35:14 2015 -0500

    1222627: Allows removal of product certs with no active repos, given temp_disabled_repos

Comment 6 Rehana 2016-01-11 18:42:33 UTC
Retested on ,

subscription management server: 0.9.51.13-1
subscription management rules: 5.15.1
subscription-manager: 1.16.7-1.el6
python-rhsm: 1.16.5-1.el6

As mentioned in comment 2 , i have to remove the httpd and httpd-tools rpms to retest the bug.

1) 
# yum remove httpd httpd-tools
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-50.el6 will be erased
<snip>

Complete!
2)
REgister and auto-attach

# subscription-manager register --username=stage_auto_testuser --auto-attach
Registering to: subscription.rhn.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 5b9dd127-bfe0-4f56-9cf3-026cb8968255 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

3) List jboss subscription

# subscription-manager list --available | grep "JBoss" -A4
Subscription Name:   Red Hat JBoss Enterprise Application Platform with Management, 16 Core Standard, L3 Support Partner
Provides:            Red Hat JBoss A-MQ Clients
                     JBoss Enterprise Application Platform
                     JBoss Enterprise Web Server
                     Red Hat Enterprise MRG Messaging
SKU:                 MW0167254
Contract:            10687077
Pool ID:             8a99f9814da10f2a014db0af04f3129b

4) Attach jboss subscription

# subscription-manager attach --pool 8a99f9814da10f2a014db0af04f3129b
Successfully attached a subscription for: Red Hat JBoss Enterprise Application Platform with Management, 16 Core Standard, L3 Support Partner

5) Enable repo

# subscription-manager repos --enable jb-eap-6-for-rhel-6-server-rpms
Repository 'jb-eap-6-for-rhel-6-server-rpms' is enabled for this system.

6) Currently enabled to  repos

[root@dhcp71-169 product]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-6-server-rpms
Repo Name: Red Hat Enterprise Linux 6 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/os
Enabled:   1

Repo ID:   rhel-server-dts2-6-rpms
Repo Name: Red Hat Developer Toolset 2 RPMs for Red Hat Enterprise Linux 6 Server
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/devtoolset/2/os
Enabled:   1

Repo ID:   rhel-server-dts-6-rpms
Repo Name: Red Hat Developer Toolset RPMs for Red Hat Enterprise Linux 6 Server
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/devtoolset/os
Enabled:   1

Repo ID:   rhel-6-server-eus-rpms
Repo Name: Red Hat Enterprise Linux 6 Server - Extended Update Support (RPMs)
Repo URL:  https://cdn.redhat.com/content/eus/rhel/server/6/$releasever/$basearch/os
Enabled:   1

Repo ID:   jb-eap-6-for-rhel-6-server-rpms
Repo Name: JBoss Enterprise Application Platform 6 (RHEL 6 Server) (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/jbeap/6/os
Enabled:   1

7) Disabling all the repos except "jb-eap-6-for-rhel-6-server-rpms" and "rhel-6-server-rpms"

# subscription-manager repos --disable=rhel-server-dts2-6-rpms --disable=rhel-server-dts-6-rpms --disable=rhel-6-server-eus-rpms
Repository 'rhel-6-server-eus-rpms' is disabled for this system.
Repository 'rhel-server-dts2-6-rpms' is disabled for this system.
Repository 'rhel-server-dts-6-rpms' is disabled for this system.

# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-6-server-rpms
Repo Name: Red Hat Enterprise Linux 6 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/os
Enabled:   1

Repo ID:   jb-eap-6-for-rhel-6-server-rpms
Repo Name: JBoss Enterprise Application Platform 6 (RHEL 6 Server) (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/jbeap/6/os
Enabled:   1

8) Install rpms from the enabled repos

# yum -y -q install jline-eap6 zsh
# yumdb get from_repo jline-eap6 zsh
Loaded plugins: product-id, refresh-packagekit
jline-eap6-0.9.94-10.GA_redhat_2.ep6.el6.4.noarch
     from_repo = jb-eap-6-for-rhel-6-server-rpms
zsh-4.3.11-4.el6_7.1.x86_64
     from_repo = rhel-6-server-rpms
[root@dhcp71-169 product]# cat /var/lib/rhsm/productid.js
{
  "69": [
    "anaconda-RedHatEnterpriseLinux-201601102011.x86_64", 
    "rhel-6-server-rpms"
  ], 
  "183": [
    "jb-eap-6-for-rhel-6-server-rpms"
  ]
}

9) notice prd cert 183.pem is installed now

# subscription-manager list --installed


+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   JBoss Enterprise Application Platform
Product ID:     183
Version:        6.0
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         
Ends:           

Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.8-Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/01/2015
Ends:           01/12/2016


10) Now remove the jboss package from the system with server repo disabled

# yum -y -q remove jline-eap6 --disablerepo=rhel-6-server-rpms

Observed that now the prd cert 183.pem removed from the system

# cat /var/lib/rhsm/productid.js 
{
  "69": [
    "anaconda-RedHatEnterpriseLinux-201601102011.x86_64", 
    "rhel-6-server-rpms"
  ]
}

11)# subscription-manager list --installed

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.8-Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         05/01/2015
Ends:           01/12/2016

[root@dhcp71-169 product]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.13-1
subscription management rules: 5.15.1
subscription-manager: 1.16.7-1.el6
python-rhsm: 1.16.5-1.el6

Marking verified!!!

Comment 8 errata-xmlrpc 2016-05-10 20:36:50 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.

https://rhn.redhat.com/errata/RHBA-2016-0797.html


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