Bug 849483 - rhn-migrate-classic-to-rhsm fails to prompt for needed System Engine org credentials
Summary: rhn-migrate-classic-to-rhsm fails to prompt for needed System Engine org cred...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Alex Wood
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771748
TreeView+ depends on / blocked
 
Reported: 2012-08-19 22:15 UTC by John Sefler
Modified: 2013-01-08 03:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Incomplete implementation of migration from a standalone System Engine server. Consequence: Migration failed when an organization was required for registration. Fix: Solicit the user for the organization name if necessary. Result: Migration works when an organization is required for registration.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:59:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0033 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-01-08 08:38:27 UTC

Description John Sefler 2012-08-19 22:15:31 UTC
Description of problem:
When migrating from RHN Classic to a non-hosted candlepin, rhsm-migrate-classic-to-rhsm will prompt you for a System Engine username/password, but no organization (when needed).  As a result the registration fails.


Version-Release number of selected component (if applicable):
[root@jsefler-rhel59 ~]# subscription-manager version
registered to: Unknown
server type: RHN Classic
subscription-manager: 1.0.13-1.git.45.5cb55c8.el5
python-rhsm: 1.0.5-1.git.1.1ce0910.el5


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel59 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=******* --profilename=rhsm-automation.jsefler-rhel59.usersys.redhat.com --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-rhel59 ~]# rhn-channel --list
rhel-x86_64-server-5
[root@jsefler-rhel59 ~]# rhn-migrate-classic-to-rhsm --serverurl=https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Red Hat account: qa 
Password: 
System Engine Username: testuser1
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-5

List of channels for which certs are being copied
rhel-x86_64-server-5

Product certificates copied 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 ...
You must specify an organization for new consumers.

Unable to register.
For further assistance, please contact Red Hat Global Support Services.
[root@jsefler-rhel59 ~]# 

  
Actual results:
above

Expected results:
expected to be prompted for a System Engine Organization (when needed).




Additional info:
# tail -f /var/log/rhsm/rhsm.log
2012-08-19 18:04:05,188 [INFO]  @connection.py:490 - Using basic authentication as: testuser1
2012-08-19 18:04:05,189 [INFO]  @connection.py:511 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-08-19 18:04:05,191 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-08-19 18:04:05,191 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-08-19 18:04:05,193 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2012-08-19 18:04:05,194 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-08-19 18:04:05,194 [DEBUG]  @connection.py:344 - Making request: GET /candlepin/users/testuser1/owners
2012-08-19 18:04:05,283 [DEBUG]  @connection.py:357 - Response status: 200
2012-08-19 18:04:06,525 [INFO]  @rhn-migrate-classic-to-rhsm:440 - Using mapping file /usr/share/rhsm/product/RHEL-5/channel-cert-mapping.txt
2012-08-19 18:04:06,530 [INFO]  @rhn-migrate-classic-to-rhsm:457 - mapping found for : rhel-x86_64-server-5 = Server-Server-x86_64-dfb340743a6e-69.pem
2012-08-19 18:04:06,530 [INFO]  @rhn-migrate-classic-to-rhsm:485 - certs to be copied: ['Server-Server-x86_64-dfb340743a6e-69.pem']
2012-08-19 18:04:06,533 [INFO]  @rhn-migrate-classic-to-rhsm:499 - cp /usr/share/rhsm/product/RHEL-5/Server-Server-x86_64-dfb340743a6e-69.pem /etc/pki/product/69.pem 
2012-08-19 18:04:06,538 [INFO]  @rhn-migrate-classic-to-rhsm:327 - Deleting system 1023062900 from RHN Classic...
2012-08-19 18:04:07,247 [INFO]  @rhn-migrate-classic-to-rhsm:330 - System 1023062900 deleted.  Removing systemid file and disabling rhnplugin.conf
2012-08-19 18:04:07,248 [INFO]  @rhn-migrate-classic-to-rhsm:344 - Disabling rhnplugin.conf
2012-08-19 18:04:07,603 [INFO]  @connection.py:508 - Using no auth
2012-08-19 18:04:07,603 [INFO]  @connection.py:511 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-08-19 18:04:07,604 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-08-19 18:04:07,604 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-08-19 18:04:07,605 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2012-08-19 18:04:07,605 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-08-19 18:04:07,606 [DEBUG]  @connection.py:344 - Making request: GET /candlepin/status/
2012-08-19 18:04:07,639 [DEBUG]  @connection.py:357 - Response status: 200
2012-08-19 18:04:07,643 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2012-08-19 18:04:07,874 [DEBUG]  @managercli.py:251 - Client Versions: {'subscription manager': '1.0.13-1.git.45.5cb55c8.el5', 'python-rhsm': '1.0.5-1.git.1.1ce0910.el5'} 
2012-08-19 18:04:07,875 [INFO]  @connection.py:498 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2012-08-19 18:04:07,875 [INFO]  @connection.py:511 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-08-19 18:04:07,876 [DEBUG]  @managercli.py:258 - Server Versions: Not registered, unable to check server version
2012-08-19 18:04:07,965 [INFO]  @connection.py:490 - Using basic authentication as: testuser1
2012-08-19 18:04:07,966 [INFO]  @connection.py:511 - Connection Built: host: jsefler-f14-candlepin.usersys.redhat.com, port: 8443, handler: /candlepin
2012-08-19 18:04:07,968 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-08-19 18:04:07,969 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-08-19 18:04:07,970 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2012-08-19 18:04:07,971 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-08-19 18:04:07,972 [DEBUG]  @connection.py:344 - Making request: GET /candlepin/users/testuser1/owners
2012-08-19 18:04:07,999 [DEBUG]  @connection.py:357 - Response status: 200
2012-08-19 18:04:08,120 [DEBUG]  @cert_sorter.py:106 - Sorting product and entitlement cert status for: 2012-08-19 22:04:08.119663+00:00
2012-08-19 18:04:08,163 [DEBUG]  @cert_sorter.py:160 - Installed product IDs: ['100000000000006', '1000000000000023', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '99000', '27060', '69', '37090', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000060', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '71', '88888', '917571', '37070']
2012-08-19 18:04:08,164 [DEBUG]  @cert_sorter.py:113 - valid entitled products: []
2012-08-19 18:04:08,164 [DEBUG]  @cert_sorter.py:114 - expired entitled products: []
2012-08-19 18:04:08,164 [DEBUG]  @cert_sorter.py:115 - partially entitled products: []
2012-08-19 18:04:08,164 [DEBUG]  @cert_sorter.py:116 - unentitled products: ['100000000000060', '1000000000000023', '1144', '100000000000011', '100000000000010', '100000000000013', '100000000000012', '100000000000015', '99000', '27060', '69', '917571', '1', '37069', '37068', '37080', '37065', '37067', '37060', '37062', '100000000000006', '100000000000007', '100000000000004', '100000000000005', '100000000000002', '100000000000003', '100000000000000', '100000000000001', '100000000000020', '100000000000022', '100000000000009', '100000000000008', '71', '88888', '37090', '37070']
2012-08-19 18:04:08,165 [DEBUG]  @cert_sorter.py:117 - future products: []
2012-08-19 18:04:08,165 [DEBUG]  @cert_sorter.py:118 - partial stacks: []
2012-08-19 18:04:08,165 [DEBUG]  @cert_sorter.py:119 - valid stacks: []
2012-08-19 18:04:08,166 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-08-19 18:04:08,166 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-08-19 18:04:08,167 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/jsefler-f14-candlepin.pem'
2012-08-19 18:04:08,167 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-08-19 18:04:08,168 [DEBUG]  @connection.py:344 - Making request: POST /candlepin/consumers
2012-08-19 18:04:08,229 [DEBUG]  @connection.py:357 - Response status: 400
2012-08-19 18:04:08,230 [ERROR]  @managercli.py:957 - You must specify an organization for new consumers.
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 954, in _do_command
    installed_products=self.installed_mgr.format_for_server())
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 574, in registerConsumer
    return self.conn.request_post(url, params)
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 403, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 362, in _request
    self.validateResponse(result)
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 387, in validateResponse
    raise RestlibException(response['status'], error_msg)
RestlibException: You must specify an organization for new consumers.

Comment 1 RHEL Program Management 2012-08-19 22:18:01 UTC
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 Alex Wood 2012-08-22 14:43:19 UTC
commit dcfa3877371b994d66f87813edf7b3caecb4a82e
Refs: <origin/awood/849483>, awood/849483, subscription-manager-1.0.14-1-11-gdc~
Author:     Alex Wood <awood>
AuthorDate: Tue Aug 21 15:54:18 2012 -0400
Commit:     Alex Wood <awood>
CommitDate: Tue Aug 21 15:57:48 2012 -0400

    849483: Prompt user for org name if necessary.

Comment 6 errata-xmlrpc 2013-01-08 03:59:24 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-0033.html


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