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 883123 - Migration from RHN classic fails to find organization
Summary: Migration from RHN classic fails to find organization
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 6.4
Assignee: candlepin-bugs
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On: 883121
Blocks: 771481 sam12-tracker 880710 888457
TreeView+ depends on / blocked
 
Reported: 2012-12-03 20:19 UTC by Tom McKay
Modified: 2013-02-21 09:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 883121
Environment:
Last Closed: 2013-02-21 09:01:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 880710 0 unspecified CLOSED subscription-manager problems when organization label is different than name 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2013:0350 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-02-20 20:53:35 UTC

Internal Links: 880710

Description Tom McKay 2012-12-03 20:19:06 UTC
+++ 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
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
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
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 08:36:59 UTC
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 15:21:25 UTC
See BZ 880710 for commits for this fix.

Comment 4 Og Maciel 2012-12-11 18:01:22 UTC
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 19:44:43 UTC
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
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 19:46:11 UTC
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 21:59:25 UTC
Moving to subscription manager as 880710 tracks the server side changes.

Comment 10 Bryan Kearney 2012-12-11 22:00:16 UTC
commit 6bd96bb108f44c8cb34d7589e988e057e02cc3ed
Author: Bryan Kearney <bkearney>
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 21:01:58 UTC
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 09:01:39 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-0350.html


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