Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1431334

Summary: Migrating Satellite 5 installations from RHN to RHSM fails if the user has a username which is an email address.
Product: [Retired] Red Hat Network Reporter: Rich Jerrido <rjerrido>
Component: RHN/RegistrationAssignee: Richard Bernleithner <rbernlei>
Status: CLOSED WONTFIX QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: RHN StableCC: agk, bsaylor, cshereme, dyordano, fcami, jhutar, joliver, ktordeur, mkalyat, risantam, shughes, tdeanton, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-13 18:33:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1459619    
Bug Blocks:    

Description Rich Jerrido 2017-03-11 11:22:48 UTC
Description of problem:


When following the processes as described in (https://access.redhat.com/articles/2884191) to migrate a Satellite 5 installation from RHN to RHSM, the user is unable to activate their Satellite if their RHN username is an email address (such as joe). 

Version-Release number of selected component (if applicable):
spacewalk-backend-2.3.3-46.el6sat.noarch

How reproducible:
100%


Steps to Reproduce:

On your Satellite 5 installation that is registered to RHN install subscription-manager{,-migration}

# yum install subscription-manager subscription-manager-migration


 
# rhn-migrate-classic-to-rhsm
Legacy username:  joe
Legacy password:  <YOUR_RHN_PASSWORD>

# rhn-satellite-activate -vvv --rhn-cert=/path/to/cert.xml

Actual results:

Traceback similar to the following

RHN_PARENT: satellite.rhn.redhat.com
HTTP_PROXY: None
HTTP_PROXY_USERNAME: None
HTTP_PROXY_PASSWORD: <password>
CA_CERT: /usr/share/rhn/RHNS-CA-CERT
Checking cert XML sanity and GPG signature: '/usr/bin/validate-sat-cert.pl --keyring /etc/webapp-keyring.gpg /etc/sysconfig/rhn/rhn-entitlement-cert.xml-TyPUGN'
Database connectioned initialized: refer to /etc/rhn/rhn.conf
Attempting local RHN Certificate push (and therefore activation)
Executing: remote XMLRPC activation call.
Error reported from RHN: <Fault -2: 'unhandled internal exception: \nError Message:\n    Invalid username provided when registering system\nError Class Code: 2\nError Class Info: \n     Invalid username and password combination.\n\n     If you are using email address as a login, try using your associated\n     login name instead.\nExplanation: \n     An error has occurred while processing your request. If this problem\n     persists please enter a bug report at bugzilla.redhat.com.\n     If you choose to submit the bug report, please be sure to include\n     details of what you were trying to do when this error occurred and\n     details on how to reproduce this problem.\n'>
ERROR: unhandled XMLRPC fault upon remote activation: <Fault -2: 'unhandled internal exception: \nError Message:\n    Invalid username provided when registering system\nError Class Code: 2\nError Class Info: \n     Invalid username and password combination.\n\n     If you are using email address as a login, try using your associated\n     login name instead.\nExplanation: \n     An error has occurred while processing your request. If this problem\n     persists please enter a bug report at bugzilla.redhat.com.\n     If you choose to submit the bug report, please be sure to include\n     details of what you were trying to do when this error occurred and\n     details on how to reproduce this problem.\n'>

ERROR: <Fault -2: 'unhandled internal exception: \nError Message:\n    Invalid username provided when registering system\nError Class Code: 2\nError Class Info: \n     Invalid username and password combination.\n\n     If you are using email address as a login, try using your associated\n     login name instead.\nExplanation: \n     An error has occurred while processing your request. If this problem\n     persists please enter a bug report at bugzilla.redhat.com.\n     If you choose to submit the bug report, please be sure to include\n     details of what you were trying to do when this error occurred and\n     details on how to reproduce this problem.\n'>


Expected results:

Successful activation

Additional info:


If user uses (or creates) an account whose username is NOT an email address, activation works without issue.

Comment 1 Jan Dobes 2017-03-13 09:40:10 UTC
Relevant error message:
"Invalid username and password combination. If you are using email address as a login, try using your associated login name instead."

It seems as limitation of the new activation API on RHN side.

Comment 3 Tomas Lestach 2017-03-13 11:25:27 UTC
The exception is coming from RHN. I'm not aware of anything, what could be done on the Satellite 5 side.

Looking into RHN git (not sure, whether checking the correct branch), I think the relevant code is:
 * backend/src/server/handlers/redhat_xmlrpc/registration.py
 * backend/src/server/rhnUser.py

Flipping the BZ over to RHN and adding Jake to CC.

Comment 4 Grant Gainey 2017-03-13 12:39:22 UTC
The RHSM-to-RHN path is new - it's almost certainly the cause, not the existing registration.py path

Comment 8 Kenny Tordeurs 2017-06-02 14:16:20 UTC
I confirm this issue can be resolved by creating a new user that is not an email address as login.