Bug 883123 - Migration from RHN classic fails to find organization
Migration from RHN classic fails to find organization
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity high
: rc
: 6.4
Assigned To: candlepin-bugs
IDM QE LIST
:
Depends On: 883121
Blocks: 771481 sam12-tracker 880710 888457
  Show dependency treegraph
 
Reported: 2012-12-03 15:19 EST by Tom McKay
Modified: 2013-02-21 04:01 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 883121
Environment:
Last Closed: 2013-02-21 04:01:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Tom McKay 2012-12-03 15:19:06 EST
+++ This bug was initially created as a clone of Bug #883121 +++

Created attachment 657000 [details]
production.log tb

Description of problem:

The issue here seems to be that subscription-manager uses the organization "key" to register a client but the organization is not being found by the org name or key.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

* Register a client to RHN "classic"
* Install katello/sam and configure it
* Create a new Org: SAM QE with environments: Library > DEV > QE > GA.
* Import a valid manifest into the SAM QE org
* Now try to register this same client to a running instance of katello/headpin

Actual results:

The migration script will prompt the user to provide the org Name. However, when I do use "SAM QE" I get a message stating "No such org". If I use the organization label ("SAM_QE") I then get "Unable to connect to certificate server: Couldn't find organization 'SAM_QE'.  See /var/log/rhsm/rhsm.log for more details."

Expected results:


Additional info:

# subscription-manager orgs --username admin --password admin
+-------------------------------------------+
          admin Organizations
+-------------------------------------------+

Name:   SAM QE
Key:    SAM_QE

Name:   ACME_Corporation
Key:    ACME_Corporation

# subscription-manager environments --org "SAM QE" --username admin --password admin
+-------------------------------------------+
          Environments
+-------------------------------------------+
Name:                   GA
Description:

Name:                   QE
Description:

Name:                   DEV
Description:

# rhn-migrate-classic-to-rhsm --serverurl=qetello05.usersys.redhat.com/sam/api
Red Hat account: qa@redhat.com
Password:
System Engine Username: admin
Password:
Org: SAM QE
No such org: SAM QE

# rhn-migrate-classic-to-rhsm --serverurl=qetello03.usersys.redhat.com/sam/api
Red Hat account: qa@redhat.com
Password:
System Engine Username: admin
Password:
Org: SAM_QE
Unable to connect to certificate server: Couldn't find organization 'SAM_QE'.  See /var/log/rhsm/rhsm.log for more details.

# rhn-migrate-classic-to-rhsm --serverurl=qetello03.usersys.redhat.com/sam/api
Red Hat account: qa@redhat.com
Password:
System Engine Username: admin
Password:
Org: "SAM QE"
No such org: "SAM QE"

--- Additional comment from Og Maciel on 2012-12-03 15:13:44 EST ---

Here's the current test case for this:  https://tcms.engineering.redhat.com/case/229969/?from_plan=6660

Also see https://bugzilla.redhat.com/show_bug.cgi?id=880710

--- Additional comment from RHEL Product and Program Management on 2012-12-03 15:16:33 EST ---

Since this issue was entered in bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
Comment 1 Lukas Zapletal 2012-12-07 03:36:59 EST
It looks like Brad fixed the bz#880710 and I have merged it master today.

I also do not understand this scenario. According to our documentration, you should always unregister rhn classic before proceeding with registration with subscription-manager. I don't see the step of deleting consumer_id before the last step.
Comment 2 Tom McKay 2012-12-07 10:21:25 EST
See BZ 880710 for commits for this fix.
Comment 4 Og Maciel 2012-12-11 13:01:22 EST
Had to use the org label to make it work:

[root@qeclient01 ~]# rhn-migrate-classic-to-rhsm --serverurl=ivanova.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: Administrator
Password: 
Org: Simple Org
No such org: Simple Org

[root@qeclient01 ~]# rhn-migrate-classic-to-rhsm --serverurl=ivanova.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: Administrator
Password: 
Org: "Simple Org"
No such org: "Simple Org"

[root@qeclient01 ~]# rhn-migrate-classic-to-rhsm --serverurl=ivanova.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: Administrator
Password: 
Org: Simple\ Org
No such org: Simple\ Org

[root@qeclient01 ~]# rhn-migrate-classic-to-rhsm --serverurl=ivanova.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: Administrator
Password: 
Org: Simple_Org
Environment: DEV

Retrieving existing RHN Classic subscription information ...

+-----------------------------------------------------+ 
System is currently subscribed to these RHN Classic Channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

+-----------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

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: fbfef32d-80ef-4284-a3bc-96a35867fc24 
System 'qeclient01.xxx.yyy.zzz' successfully registered to Red Hat Subscription Management.

Attempting to auto-attach to appropriate subscriptions ...
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed
[root@qeclient01 ~]# yum repolist
Loaded plugins: product-id, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
rhel-6-server-cf-tools-1-rpms                                      | 2.8 kB     00:00     
rhel-6-server-cf-tools-1-rpms/primary_db                           |  18 kB     00:00     
rhel-6-server-rpms                                                 | 3.7 kB     00:00     
rhel-6-server-rpms/primary_db                                      |  17 MB     01:16     
repo id                            repo name                                        status
rhel-6-server-cf-tools-1-rpms      Red Hat CloudForms Tools for RHEL 6 (RPMs)          31
rhel-6-server-rpms                 Red Hat Enterprise Linux 6 Server (RPMs)         8,758
repolist: 8,789


also, does not handle spaces in the environment name:


[root@qeclient02 ~]# rhn-migrate-classic-to-rhsm --serverurl=cloud-qe-2.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: SAM_QE
Environment: Dev_Env
No such environment: Dev_Env

[root@qeclient02 ~]# subscription-manager environments --org SAM_QE
Username: admin
Password: 
+-------------------------------------------+
          Environments
+-------------------------------------------+
Name:                 	GA Env
Description:          	

Name:                 	QE Env
Description:          	

Name:                 	Dev Env
Description:          	

[root@qeclient02 ~]# rhn-migrate-classic-to-rhsm --serverurl=cloud-qe-2.xxx.yyy.zzz.com/sam/api
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: SAM_QE
Environment: Dev\ Env
No such environment: Dev\ Env

Candlepin:
==========

candlepin=> select * from cp_owner where account='Simple_Org';
                id                |          created           |          updated          | contentprefix | defaultservicelevel | displayname |  account   |            upstr
eam_uuid             | parent_owner 
----------------------------------+----------------------------+---------------------------+---------------+---------------------+-------------+------------+--------------------------------------+--------------
 8a90e0cf3b8a57ac013b8a79cb650001 | 2012-12-11 09:58:55.973-05 | 2012-12-11 10:05:59.49-05 |               |                     | Simple Org  | Simple_Org | 535abc2c-349e-40a5-b7e5-43c3664f69e5 | 
(1 row)
Comment 5 Og Maciel 2012-12-11 14:44:43 EST
Seems that passing the environment name (not the label) would work. You still need to use the ORG label though.

[root@qeclient02 ~]# rhn-migrate-classic-to-rhsm --serverurl=cloud-qe-2.idm.lab.bos.redhat.com/sam/api
Red Hat account: qa@redhat.com
Password: 
System Engine Username: admin
Password: 
Org: SAM_QE
Environment: Dev Env

Retrieving existing RHN Classic subscription information ...

+-----------------------------------------------------+ 
System is currently subscribed to these RHN Classic Channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

+-----------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

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

Preparing to unregister system from RHN Classic ...
Comment 6 Og Maciel 2012-12-11 14:46:11 EST
I feel that the migration script should be consistent and handle both org/env names/labels. Fails QE.

* candlepin-0.7.19-1.el6_3.noarch
* candlepin-tomcat6-0.7.19-1.el6_3.noarch
* elasticsearch-0.19.9-5.el6_3.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.2.1-1h.el6_3.noarch
* katello-cli-1.2.4-4h.el6_3.noarch
* katello-cli-common-1.2.4-4h.el6_3.noarch
* katello-common-1.2.6-6h.el6_3.noarch
* katello-configure-1.2.3-1h.el6_3.noarch
* katello-glue-candlepin-1.2.6-6h.el6_3.noarch
* katello-headpin-1.2.6-6h.el6_3.noarch
* katello-headpin-all-1.2.6-6h.el6_3.noarch
* katello-selinux-1.2.1-1h.el6_3.noarch
* thumbslug-0.0.27-1.el6_3.noarch
* thumbslug-selinux-0.0.27-1.el6_3.noarch
Comment 9 Bryan Kearney 2012-12-11 16:59:25 EST
Moving to subscription manager as 880710 tracks the server side changes.
Comment 10 Bryan Kearney 2012-12-11 17:00:16 EST
commit 6bd96bb108f44c8cb34d7589e988e057e02cc3ed
Author: Bryan Kearney <bkearney@redhat.com>
Date:   Tue Dec 11 15:03:28 2012 -0500

    883123: Have the migration code use the name and the label for org and environment lookup.
Comment 14 Og Maciel 2013-01-02 16:01:58 EST
Verified:

* candlepin-0.7.23-1.el6_3.noarch
* candlepin-tomcat6-0.7.23-1.el6_3.noarch
* elasticsearch-0.19.9-5.el6_3.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.2.1-1h.el6_3.noarch
* katello-cli-1.2.1-11h.el6_3.noarch
* katello-cli-common-1.2.1-11h.el6_3.noarch
* katello-common-1.2.1-10h.el6_3.noarch
* katello-configure-1.2.3-1h.el6_3.noarch
* katello-glue-candlepin-1.2.1-10h.el6_3.noarch
* katello-headpin-1.2.1-10h.el6_3.noarch
* katello-headpin-all-1.2.1-10h.el6_3.noarch
* katello-selinux-1.2.1-1h.el6_3.noarch
* thumbslug-0.0.28-1.el6_3.noarch
* thumbslug-selinux-0.0.28-1.el6_3.noarch
* subscription-manager-1.1.18-1.el6.x86_64
* subscription-manager-migration-data-1.12.2.6-1.el6.noarch
* subscription-manager-migration-1.1.18-1.el6.x86_64
Comment 16 errata-xmlrpc 2013-02-21 04:01:39 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-0350.html

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