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 875153 - rhn-migrate-classic-to-rhsm leaves system unregistered when a non-existant environment is specified/mistyped
Summary: rhn-migrate-classic-to-rhsm leaves system unregistered when a non-existant en...
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
: ---
Assignee: Adrian Likins
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On: 866579
Blocks: 771481
TreeView+ depends on / blocked
 
Reported: 2012-11-09 16:32 UTC by Adrian Likins
Modified: 2013-02-21 09:00 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.1.4-1
Doc Type: Known Issue
Doc Text:
During the migration process, the rhn-migrate-classic-to-rhsm utility leaves the system unregistered when a non-existent environment is specified or mistyped. The registration process consequently fails with a No such environment error message.
Clone Of: 866579
Environment:
Last Closed: 2013-02-21 09:00:22 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

Comment 2 John Sefler 2012-11-19 16:07:48 UTC
Attempting to re-verify, we ran into some key/name/label confusion that has blocked us from a successful migration to a cfse server with credentials to a specific org and a specific environment.

Prior to running the migrations, we check the available orgs and the environments on the CFSE server...

> # 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:

Notice above that the available org's Name and Key differ (which is acceptable), and that in order to see the environments available to the org, we had to pass the org's Name (did not expect that; thought the key is what should have been passed; there is no indication in the online help what should be passed - name or key or label?).
> # subscription-manager environments --help | grep ORG
>    --org=ORG             specify organization for environment list


Consequently rhn-migrate-classic-to-rhsm fails when attemptiog to specify either org name "SAM QE" or org key "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"
> 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.

Moving back to ASSIGNED/FailedQA

Comment 3 Matt Reid 2012-11-19 16:15:28 UTC
(In reply to comment #2)
> Attempting to re-verify, we ran into some key/name/label confusion that has
> blocked us from a successful migration to a cfse server with credentials to
> a specific org and a specific environment.
> 
> Prior to running the migrations, we check the available orgs and the
> environments on the CFSE server...
> 
> > # 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:
> 
> Notice above that the available org's Name and Key differ (which is
> acceptable), and that in order to see the environments available to the org,
> we had to pass the org's Name (did not expect that; thought the key is what
> should have been passed; there is no indication in the online help what
> should be passed - name or key or label?).
> > # subscription-manager environments --help | grep ORG
> >    --org=ORG             specify organization for environment list
> 

We can update the strings to be more specific, but the fact that we aren't consistent in what we ask for (needing key most places, but needing name in environment --org) to complete these commands is worrisome.

Comment 4 John Sefler 2012-12-03 16:18:21 UTC
This bug is partially blocked by bug 880710
String/description clarifications will be handled by bug 878097

Comment 7 John Sefler 2013-01-03 20:53:27 UTC
Verifying Version...
[root@rhsm-accept-rhel6 ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.1.18-1.el6.x86_64
Against...
Subscription Asset Manager Version: 1.2.1-10h.el6_3


[root@rhsm-accept-rhel6 ~]# rpm -Uvh http://qeblade3.rhq.lab.eng.bos.redhat.com/pub/candlepin-cert-consumer-qeblade3.rhq.lab.eng.bos.redhat.com-1.0-1.noarch.rpm
Retrieving http://qeblade3.rhq.lab.eng.bos.redhat.com/pub/candlepin-cert-consumer-qeblade3.rhq.lab.eng.bos.redhat.com-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:candlepin-cert-consumer########################################### [100%]
[root@rhsm-accept-rhel6 ~]# subscription-manager orgs --username admin
Password: 
+-------------------------------------------+
          admin Organizations
+-------------------------------------------+

Name: 	SAM QE
Key: 	SAM_QE

Name: 	ACME_Corporation
Key: 	ACME_Corporation

[root@rhsm-accept-rhel6 ~]# subscription-manager environments --org SAM_QE --username admin
Password: 
+-------------------------------------------+
          Environments
+-------------------------------------------+
Name:                 	Dev Env                 <==== NOTE: Label/Key is Dev_Env
Description:          	Development

Name:                 	QE Env                  <==== NOTE: Label/Key is QE_Env
Description:          	

[root@rhsm-accept-rhel6 ~]# 


[root@rhsm-accept-rhel6 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=**** --force --norhnsd --nohardware --nopackages --novirtinfo
[root@rhsm-accept-rhel6 ~]# rhn-channel --list
rhel-x86_64-server-6
[root@rhsm-accept-rhel6 ~]# ls /etc/sysconfig/rhn/systemid
/etc/sysconfig/rhn/systemid
[root@rhsm-accept-rhel6 ~]# subscription-manager list --installed
No installed products to list



Case 1: user mistypes the org during migration...

[root@rhsm-accept-rhel6 ~]# rhn-migrate-classic-to-rhsm --no-autoRed Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: foo
No such org: foo
[root@rhsm-accept-rhel6 ~]# rhn-channel --list
rhel-x86_64-server-6
[root@rhsm-accept-rhel6 ~]# ls /etc/sysconfig/rhn/systemid
/etc/sysconfig/rhn/systemid

^^^ VERIFIED: Still registered classically when org is mistyped



Case 2: user mistypes the env during migration...

[root@rhsm-accept-rhel6 ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: SAM_QE
Environment: foo
No such environment: foo
[root@rhsm-accept-rhel6 ~]# rhn-channel --list
rhel-x86_64-server-6
[root@rhsm-accept-rhel6 ~]# ls /etc/sysconfig/rhn/systemid
/etc/sysconfig/rhn/systemid

^^^ VERIFIED: Still registered classically when env is mistyped



Case 3: user correctly enters org and env during migration...

[root@rhsm-accept-rhel6 ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: SAM_QE
Environment: QE_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 ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: ea4516d6-04e4-4303-bd4e-c96e7c374373 
System 'rhsm-accept-rhel6.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@rhsm-accept-rhel6 ~]# rhn-channel --list
Unable to locate SystemId file. Is this system registered?
[root@rhsm-accept-rhel6 ~]# ls /etc/sysconfig/rhn/systemid
ls: cannot access /etc/sysconfig/rhn/systemid: No such file or directory
[root@rhsm-accept-rhel6 ~]# subscription-manager identity
Current identity is: ea4516d6-04e4-4303-bd4e-c96e7c374373
name: rhsm-accept-rhel6.usersys.redhat.com
org name: SAM QE
org id: SAM_QE
[root@rhsm-accept-rhel6 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Red Hat Enterprise Linux Server
Product ID:           	69
Version:              	6.4
Arch:                 	x86_64
Status:               	Not Subscribed
Starts:               	
Ends:                 	

VERIFIED: A successful migration from RHN Classic to SAM even after mistyping org and env keys.




Let's test again using the org and env name (instead of key)...

[root@rhsm-accept-rhel6 ~]# subscription-manager unregister
System has been un-registered.
[root@rhsm-accept-rhel6 ~]# rm -f /etc/pki/product/*
[root@rhsm-accept-rhel6 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=redhatqa --force --norhnsd --nohardware --nopackages --novirtinfo
[root@rhsm-accept-rhel6 ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
Password: 
System Engine Username: admin
Password: 
Org: SAM QE
Environment: QE 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 ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: 4414d88c-2aa3-403b-992a-be09fb94afa6 
System 'rhsm-accept-rhel6.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@rhsm-accept-rhel6 ~]# 

VERIFIED: Total Success!

Comment 9 errata-xmlrpc 2013-02-21 09:00:22 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.