Bug 852894 - rhn-migrate-classic-to-rhsm should abort when classically consuming RHN Channels for multiple versions of JBEAP
rhn-migrate-classic-to-rhsm should abort when classically consuming RHN Chann...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: Alex Wood
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-08-29 17:44 EDT by John Sefler
Modified: 2013-01-07 23:01 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 23:01:27 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2012-08-29 17:44:09 EDT
Description of problem:
Although not a reccommended path, if a system was consuming classic RHN channels for multiple versions of JBoss Enterprise Application Platform:

For example:
   jbappplatform-4.3.0-i386-server-5-rpm and
   jbappplatform-5-i386-server-5-rpm
then the current implementation of rhn-migrate-classic-to-rhsm would attempt to install:
   Server-JBEAP-i386-ab0700cf21f0-183.pem and
   Server-JBEAP-i386-5696030298b2-183.pem
and during the installation it would strip off the leading prefix and install:
   183.pem
which means that one product cert would clobber the other and we end up with only one victorious product cert version of JBEAP installed.


Version-Release number of selected component (if applicable):
[root@rhsm-accept-rhel5 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.0.14-1.el5


Discussions with awood and dgregor have decided that the best solution for now is that the rhn-migrate-classic-to-rhsm should detect this possibility and abort.
If option --force is used, installing the newer version might be a good choice.
Comment 1 RHEL Product and Program Management 2012-08-29 17:47:04 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 2 RHEL Product and Program Management 2012-08-29 18:07:04 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 3 Alex Wood 2012-08-30 13:32:16 EDT
> If option --force is used, installing the newer version might be a good
> choice.

I'm leaving this bit out of the fix.
Comment 4 Alex Wood 2012-08-30 13:34:27 EDT
commit 3435ba70da8c9e3153b5fd374b52dd3a799da055
Author:     Alex Wood <awood@redhat.com>
AuthorDate: Thu Aug 30 10:24:24 2012 -0400
Commit:     Alex Wood <awood@redhat.com>
CommitDate: Thu Aug 30 10:26:40 2012 -0400
Comment 6 John Sefler 2012-08-31 14:44:27 EDT
Verifying Version...

[root@jsefler-59server ~]# rpm -q subscription-manager-migration subscription-manager-migration-data
subscription-manager-migration-1.0.17-1.el5
subscription-manager-migration-data-1.11.2.4-1.el5


[root@jsefler-59server ~]# subscription-manager config --server.hostname subscription.rhn.stage.redhat.com

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

[root@jsefler-59server ~]# rhn-channel --user=qa@redhat.com --password=**** --add --channel=jbappplatform-4.3.0-x86_64-server-5-rpm --channel=jbappplatform-5-x86_64-server-5-rpm

[root@jsefler-59server ~]# rhn-channel --user=qa@redhat.com --password=**** --list
jbappplatform-4.3.0-x86_64-server-5-rpm
jbappplatform-5-x86_64-server-5-rpm
rhel-x86_64-server-5

[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm
Red Hat account: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-server-5
jbappplatform-5-x86_64-server-5-rpm
jbappplatform-4.3.0-x86_64-server-5-rpm
You are subscribed to more than one jbappplatform channel.  This script does not support that configuration.  Exiting.

^^^^ VERIFIED: The migration is aborted when consuming multiple versions of jbappplatform.


[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm --force
Red Hat account: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-server-5
jbappplatform-5-x86_64-server-5-rpm
jbappplatform-4.3.0-x86_64-server-5-rpm
You are subscribed to more than one jbappplatform channel.  This script does not support that configuration.  Exiting.

^^^^ NOTE: Despite the --force option, the script still aborts as indicated by comment 3.  We'll save this fix for a very rainy day.




[root@jsefler-59server ~]# rhn-channel --user=qa@redhat.com --password=**** --remove --channel=jbappplatform-5-x86_64-server-5-rpm
[root@jsefler-59server ~]# rhn-channel --user=qa@redhat.com --password=**** --list
jbappplatform-4.3.0-x86_64-server-5-rpm
rhel-x86_64-server-5

[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm
Red Hat account: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-server-5
jbappplatform-4.3.0-x86_64-server-5-rpm

+--------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+--------------------------------------------------+
rhel-x86_64-server-5
jbappplatform-4.3.0-x86_64-server-5-rpm

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: 11d2741d-783b-4512-ba41-5d4afc754430 
System 'jsefler-59server.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

Attempting to auto-subscribe to appropriate subscriptions ...
Installed Product Current Status:
Product Name:         	JBoss Enterprise Application Platform
Status:               	Not Subscribed

Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed


Please visit https://access.redhat.com/management/consumers/11d2741d-783b-4512-ba41-5d4afc754430 to view the details, and to make changes if necessary.
[root@jsefler-59server ~]# 


^^^ VERIFIED: After removing one of the jbappplatform version channels leaving only one installed, then the migration completes.


Moving to VERIFIED
Comment 8 errata-xmlrpc 2013-01-07 23:01:27 EST
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-0033.html

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