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 972883 - rhn-migrate-classic-to-rhsm tool neglects to populate /var/lib/rhsm/productid.js
Summary: rhn-migrate-classic-to-rhsm tool neglects to populate /var/lib/rhsm/productid.js
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel65
TreeView+ depends on / blocked
 
Reported: 2013-06-10 18:00 UTC by John Sefler
Modified: 2013-11-21 21:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary.
Clone Of:
Environment:
Last Closed: 2013-11-21 21:26:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1659 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2013-11-20 21:53:10 UTC

Description John Sefler 2013-06-10 18:00:57 UTC
Description of problem:
As part of the rhn-migrate-classic-to-rhsm script procedure all the RHN Channels that the classically registered system is consuming are gathered, and then the script uses the information in /usr/share/rhsm/product/RHEL-6/channel-cert-mapping.txt to copy the product certs that correspond to the consumed RHN Channels into the /etc/pki/product cert directory.

The problem is that there is also a /var/lib/rhsm/productid.js file that keeps track of of all the repos that have possibly provided the installed product certs.  This information is used by the yum product-id plugin to determine when the final package from an entitled repo has been removed.  If there are no longer any packages installed from the entitled repo then the product id is removed (applies to non rhel* repos) because the product is no longer considered to be installed.

The consequence of the current implementation (where rhn-migrate-classic-to-rhsm neglects to poulate /var/lib/rhsm/productid.js) is this:
 - once a package is yum installed on a system from a post migrated certificate based entitlement, the productid.js will get newly populated with a single entry for the new CDN channel that provides the installed product cert - (this is good, however)
 - then if the package is yum removed and the CDN repo name does not exactly match the classic RHN channel name, then the product-id plugin will think that it is the final installed package from the CDN repo and remove the product cert.

Bottom line: there is no acknowledgment of packages that were previously installed while consuming the classic RHN channel which means that product certs installed by rhn-migrate-classic-to-rhsm script could get prematurely removed by the product-id yum plugin during yum removal transactions which consuming certificate based entitlements.

Comment 3 Alex Wood 2013-06-24 19:38:17 UTC
commit cae768ae42963bf0d9c598cf81cefa92360166ff
Author: Alex Wood <awood>
Date:   Thu Jun 13 10:59:55 2013 -0400

    972883: Add entries to productid.js during migration.

Comment 7 Bryan Kearney 2013-06-27 15:39:11 UTC
All modifeid bugs are in a build now. MOving to ON_QA

Comment 8 John Sefler 2013-07-17 15:19:27 UTC
Verifying Version....
[root@jsefler-5 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.8.13-1.el5

[root@jsefler-5 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=****** --force --norhnsd --nohardware --nopackages --novirtinfo

[root@jsefler-5 ~]# rhn-channel --add -c rhel-x86_64-server-eucjp-5 -c rhel-x86_64-server-dts-5 -c rhel-x86_64-server-scalefs-5 -c rhel-x86_64-server-sjis-5 -c rhel-x86_64-server-cluster-5 -c rhel-x86_64-server-productivity-5 -c rhel-x86_64-rhev-agent-5-server-beta
Username: qa
Password: 

[root@jsefler-5 ~]# rhn-channel --list
rhel-x86_64-rhev-agent-5-server-beta
rhel-x86_64-server-5
rhel-x86_64-server-cluster-5
rhel-x86_64-server-dts-5
rhel-x86_64-server-eucjp-5
rhel-x86_64-server-productivity-5
rhel-x86_64-server-scalefs-5
rhel-x86_64-server-sjis-5

[root@jsefler-5 ~]# cat /var/lib/rhsm/productid.js 
{
  "69": "anaconda-base-201202021136.x86_64", 
}

[root@jsefler-5 ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 
System Engine Username: testuser1
Password: 
Org: admin

Retrieving existing RHN Classic subscription information...

+-----------------------------------------------------+
System is currently subscribed to these RHN Classic Channels:
+-----------------------------------------------------+
rhel-x86_64-server-5
rhel-x86_64-server-dts-5
rhel-x86_64-rhev-agent-5-server-beta
rhel-x86_64-server-sjis-5
rhel-x86_64-server-productivity-5
rhel-x86_64-server-cluster-5
rhel-x86_64-server-eucjp-5
rhel-x86_64-server-scalefs-5

+-----------------------------------------------------+
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-5
rhel-x86_64-server-dts-5
rhel-x86_64-rhev-agent-5-server-beta
rhel-x86_64-server-sjis-5
rhel-x86_64-server-productivity-5
rhel-x86_64-server-cluster-5
rhel-x86_64-server-eucjp-5
rhel-x86_64-server-scalefs-5

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from RHN Classic...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management...
The system has been registered with ID: ef0703a0-3a5a-4ba9-90d0-801d79779a71 
System 'jsefler-5.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@jsefler-5 ~]# cat /var/lib/rhsm/productid.js 
{
  "176": [
    "rhel-x86_64-server-dts-5"
  ], 
  "181": [
    "rhel-x86_64-server-eucjp-5"
  ], 
  "126": [
    "rhel-x86_64-server-sjis-5"
  ], 
  "69": [
    "rhel-x86_64-server-5", 
    "rhel-x86_64-rhev-agent-5-server-beta", 
    "rhel-x86_64-server-productivity-5"
  ], 
  "83": [
    "rhel-x86_64-server-cluster-5"
  ], 
  "92": [
    "rhel-x86_64-server-scalefs-5"
  ]
}[root@jsefler-5 ~]#


VERIFIED: /var/lib/rhsm/productid.js is now populated with productId-to-classicChannel mappings during the migration process.

Comment 9 errata-xmlrpc 2013-11-21 21:26:23 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.

http://rhn.redhat.com/errata/RHBA-2013-1659.html


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