Red Hat Satellite 5 migration from RHN to RHSM failed with error "returned status 404"

Solution Verified - Updated

Environment

  • Red Hat Satellite 5.6/5.7

Issue

  • Can't migrate Red Hat Satellite server from RHN to RHSM.
    Followed correct steps as per KCS
# rhn-migrate-classic-to-rhsm
[...]
Retrieving existing legacy subscription information...

+-----------------------------------------------------+
System is currently subscribed to these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6
rhn-tools-rhel-x86_64-server-6
redhat-rhn-satellite-5.7-server-x86_64-6

+-----------------------------------------------------+
Installing product certificates for these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6
rhn-tools-rhel-x86_64-server-6
redhat-rhn-satellite-5.7-server-x86_64-6


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

Preparing to unregister system from legacy server...
System successfully unregistered from legacy server.
Stopping and disabling legacy services...

Attempting to register system to destination server...
Registering to: subscription.rhsm.redhat.com:443/subscription
Remote server error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information.

Unable to register.
For further assistance, please contact Red Hat Global Support Services.

Entries from /var/log/rhsm/rhsm.log:

2017-03-26 19:52:29,927 [INFO] subscription-manager:21465:MainThread @managercli.py:389 - Client Versions: {'python-rhsm': '1.18.6-1.el6', 'subscription-manager': '1.18.10-1.el6'}
2017-03-26 19:52:29,928 [INFO] subscription-manager:21465:MainThread @connection.py:758 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2017-03-26 19:52:29,928 [INFO] subscription-manager:21465:MainThread @connection.py:758 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=none
2017-03-26 19:52:29,929 [INFO] subscription-manager:21465:MainThread @managercli.py:389 - Client Versions: {'python-rhsm': '1.18.6-1.el6', 'subscription-manager': '1.18.10-1.el6'}
2017-03-26 19:52:29,945 [INFO] subscription-manager:21465:MainThread @managercli.py:364 - Consumer Identity name=None uuid=None
2017-03-26 19:52:29,950 [INFO] subscription-manager:21465:MainThread @managercli.py:364 - Consumer Identity name=None uuid=None
2017-03-26 19:52:29,951 [INFO] subscription-manager:21465:MainThread @connection.py:758 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=basic username=user
2017-03-26 19:52:30,797 [INFO] subscription-manager:21465:MainThread @hwprobe.py:918 - collected virt facts: virt.is_guest=True, virt.host_type=vmware, virt.uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
2017-03-26 19:52:30,799 [INFO] subscription-manager:21465:MainThread @facts.py:139 - Loading custom facts from: /etc/rhsm/facts/migration.facts
2017-03-26 19:52:32,413 [INFO] subscription-manager:21465:MainThread @connection.py:525 - Response: status=200, request="GET /subscription/"
2017-03-26 19:52:34,310 [INFO] subscription-manager:21465:MainThread @connection.py:525 - Response: status=404, request="POST /subscription/consumers?owner=xxxx"
2017-03-26 19:52:34,311 [ERROR] subscription-manager:21465:MainThread @connection.py:554 - Response: 404
2017-03-26 19:52:34,312 [ERROR] subscription-manager:21465:MainThread @connection.py:555 - JSON parsing error: No JSON object could be decoded
2017-03-26 19:52:34,313 [ERROR] subscription-manager:21465:MainThread @managercli.py:177 - Error during registration: Server error attempting a POST to /subscription/consumers?owner=6074387 returned status 404
2017-03-26 19:52:34,313 [ERROR] subscription-manager:21465:MainThread @managercli.py:178 - Server error attempting a POST to /subscription/consumers?owner=6074387 returned status 404
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 1149, in _do_command
    content_tags=self.installed_mgr.tags)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 856, in registerConsumer
    return self.conn.request_post(url, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 626, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 534, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 593, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a POST to /subscription/consumers?owner=xxxxx returned status 404
  • Once migration failed, unable to re-execute migration script.
# rhn-migrate-classic-to-rhsm
Could not read legacy system id at /etc/sysconfig/rhn/systemid

Resolution

  • Verify whether can see any systemid file under /etc/sysconfig/rhn/ on Red Hat Satellite server. For ex: /etc/sysconfig/rhn/systemid.save.
    If yes then verify whether the ID in that file matches the ID on RHN profile.
# grep ID /etc/sysconfig/rhn/systemid.save

Login to portal and check whether the id matches with the id on satellite profile details page.
If yes then:

# mv /etc/sysconfig/rhn/systemid.save /etc/sysconfig/rhn/systemid
  • On portal go to RHN Classic and edit Red Hat Satellite profile and assign Management entitlement to it. For details refer This content is not included.KCS
  • If satellite is registered with RHN Classic then make sure the sslCACert path in /etc/sysconfig/rhn/up2date file is:
sslCACert=/usr/share/rhn/RHNS-CA-CERT
  • In case systemid file is not present on satellite then register satellite with RHN Classic using rhn_register command.
  • On terminal sync profile and active entitlement certificate forcefully with RHN Classic.
# rhn-profile-sync -vvv
# rhn-satellite-activate -v --rhn-cert=/etc/sysconfig/rhn/rhn-entitlement-cert.xml --force-rhn
  • Clear existing subscriptions data and re-try migration.
# subscription-manager clean
# rhn-migrate-classic-to-rhsm
  • Once migration completed successfully disable extra repos on satellite and enable base and satellite repos only. Then activate certificate.
# subscription-manager repos --disable=*
# subscription-manager repos --enable=rhel-6-server-rpms  --enable=rhel-6-server-satellite-5.7-rpms
# rhn-satellite-activate -v --rhn-cert=/etc/sysconfig/rhn/rhn-entitlement-cert.xml
  • Verify yum and satellite-sync works.
# yum clean all
# yum repolist
# satellite-sync -l

Root Cause

  • 404 error occurred due to temporary issue with RHN.
  • If systemid file is missing then migration failure is expected.
  • Management entitlement missing from satellite server profile on RHN Classic
SBR
Product(s)
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.