Bug 1822880

Summary: Failed to register to CDN with non organization admin user during installation
Product: Red Hat Enterprise Linux 8 Reporter: Qin Yuan <qiyuan>
Component: anacondaAssignee: Martin Kolman <mkolman>
Status: CLOSED NEXTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: urgent Docs Contact: Shweta Naresh <sjalgaon>
Priority: urgent    
Version: 8.2CC: achareka, byodlows, cshao, fperalta, jbrouer, jsefler, jsenkyri, jstodola, lmiksik, lsvaty, mavital, miminar, mkolman, mmcgrath, peyu, pkotvan, psivakum, qiyuan, rjerrido, rmetrich, sbarcomb, sbonazzo, sbueno, shlei, sjalgaon, smoroney, sriley, tgunders, vdeshpan, weiwang, yaniwang
Target Milestone: rcKeywords: Triaged
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.Registration fails for user accounts that belong to multiple organizations Currently, when you attempt to register a system with a user account that belongs to multiple organizations, the registration process fails with the error message *You must specify an organization for new units*. To work around this problem, you can either: * Use a different user account that does not belong to multiple organizations. * Use the *Activation Key* authentication method available in the Connect to Red Hat feature for GUI and Kickstart installations. * Skip the registration step in Connect to Red Hat and use Subscription Manager to register your system post-installation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-14 16:49:17 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:
Attachments:
Description Flags
logs in /tmp none

Description Qin Yuan 2020-04-10 09:28:06 UTC
Created attachment 1677764 [details]
logs in /tmp

Description of problem:
During rhvh installation, use a non organization admin user to register to CDN, registration failed with the following error:

08:54:08,504 INFO rhsm-service:ERROR [rhsmlib.dbus.util:41] HTTP error (400 - Bad Request): You must specify an organization for new units.
08:54:08,504 INFO rhsm-service:Traceback (most recent call last):
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsmlib/dbus/util.py", line 38, in dbus_handle_exceptions
08:54:08,504 INFO rhsm-service:    ret = func(*args, **kwargs)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsmlib/dbus/objects/register.py", line 123, in Register
08:54:08,504 INFO rhsm-service:    consumer = register_service.register(org, **options)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsmlib/services/register.py", line 91, in register
08:54:08,504 INFO rhsm-service:    usage=usage
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1021, in registerConsumer
08:54:08,504 INFO rhsm-service:    return self.conn.request_post(url, params)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 729, in request_post
08:54:08,504 INFO rhsm-service:    return self._request("POST", method, params, headers=headers)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 752, in _request
08:54:08,504 INFO rhsm-service:    info=info, headers=headers)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 627, in _request
08:54:08,504 INFO rhsm-service:    self.validateResponse(result, request_type, handler)
08:54:08,504 INFO rhsm-service:  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 689, in validateResponse
08:54:08,504 INFO rhsm-service:    raise RestlibException(response['status'], error_msg, response.get('headers'))
08:54:08,504 INFO rhsm-service:rhsm.connection.RestlibException: HTTP error (400 - Bad Request): You must specify an organization for new units.
08:54:08,505 WARNING org.fedoraproject.Anaconda.Modules.Subscription:DEBUG:anaconda.modules.subscription.installation:RHSM: failed to register with username and password: {"exception": "RestlibException", "severity": "error", "message": "You must specify an organization for new units."}


Version-Release number of selected component (if applicable):
RHVH-4.4-20200409.0-RHVH-x86_64-dvd1.iso

How reproducible:
100%

Steps to Reproduce:
1. Install RHVH-4.4-20200409.0-RHVH-x86_64-dvd1.iso
2. Enable network, and go to CONNECT TO RED HAT screen.
3. Adopt the following settings:
   Authentication: Account
   User name: a non organization admin user's name
   Password: the password of the non organization admin user
   Purpose: uncheck
   Insights: uncheck
   Options: no setting
4. Click Register

Actual results:
1. Registration failed, a warning popped up saying "You must specify an organization for new units"

Expected results:
1. Registration should succeed.

Additional info:
1. It succeeds to register to CDN with the same non organization admin user on an installed rhvh 4.4 system.

Comment 3 Sandro Bonazzola 2020-04-21 07:40:51 UTC
Samantha can you please review?

Comment 4 Martin Kolman 2020-04-21 11:22:43 UTC
So what is happening there if you get the "You must specify an organization for new units." error from subscription manager during an install time resgistration attempt is that the Red Hat account you are using is a member of two (or more) organizations. This is currently not supported due to missing subscription manager API needed by Anaconda to handle this case.

For RHEL 8.3 the missing subscription manager DBus API should be in place and we should be able to fix this issue, by presenting the user with a list of organizations to choose from if we find that they Red Hat account is a member of multiple organizations.

In the meantime there are two options to work around this issue:
- use a different account, that is not member of multiple organizations
- use the organization id + activation key authentication method (available both from GUI & kickstart)

Comment 5 Jesper Brouer 2020-05-13 15:29:36 UTC
*** Bug 1835281 has been marked as a duplicate of this bug. ***

Comment 6 Sandro Bonazzola 2020-05-14 07:42:25 UTC
*** Bug 1834750 has been marked as a duplicate of this bug. ***

Comment 7 Sandro Bonazzola 2020-05-26 07:37:46 UTC
Qin, can you test workarounds on comment #4

Comment 8 Qin Yuan 2020-05-26 07:53:08 UTC
Both of the two work around work fine.