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 2044258 - Cannot select organization in GUI when registering to Satellite
Summary: Cannot select organization in GUI when registering to Satellite
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: anaconda
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Martin Kolman
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1942219
TreeView+ depends on / blocked
 
Reported: 2022-01-24 10:33 UTC by Jan Stodola
Modified: 2022-05-17 12:43 UTC (History)
6 users (show)

Fixed In Version: anaconda-34.25.0.27-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:30:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ENT-4681 0 None None None 2022-01-28 11:11:31 UTC
Red Hat Issue Tracker RHELPLAN-109362 0 None None None 2022-01-24 11:33:10 UTC
Red Hat Issue Tracker RTT-3700 0 None None None 2022-02-16 17:39:20 UTC
Red Hat Issue Tracker RTT-4246 0 None None None 2022-02-15 20:44:00 UTC
Red Hat Issue Tracker RTT-4247 0 None None None 2022-02-15 20:44:06 UTC
Red Hat Product Errata RHBA-2022:2326 0 None None None 2022-05-17 12:30:56 UTC

Description Jan Stodola 2022-01-24 10:33:30 UTC
Description of problem:
When registering to a Satellite in anaconda GUI and using an account that's part of multiple organizations, anaconda doesn't provide any organization to select from in the "Organization" drop-down menu. Due to this it is not possible to use username/password to register with such an account. 

Version-Release number of selected component (if applicable):
RHEL-9.0.0-20220117.0
anaconda-34.25.0.24-1.el9
subscription-manager-1.29.21-1.el9

How reproducible:
Always (2 out of 2 attempts)

Steps to Reproduce:
1. Start graphical installation
2. Ensure network is up and running, enable it if necessary
3. Go to the Connect to Red Hat spoke
4. Enter "User name", "Password" and "Satellite URL" fields - make sure to use an account that's part of multiple organizations
5. Click "Register"

Actual results:
Anaconda says to select an organization, but the Organization drop-down menu contains only choice: "Not Specified"

Expected results:
The Organization drop-down menu lists all applicable organizations for the account.

Additional info:
* Retested on RHEL-9.0-Beta using the same account/satellite instance and there was no problem.
* I also do not see any problem when registering to the satellite instance using subscription-manager on an installed system:

[root@localhost ~]# sh katello-rhsm-consumer
[root@localhost ~]# subscription-manager register
Registering to: XYZ.redhat.com:443/rhsm
Username: test_user_multiorg
Password: 
Hint: User "test_user_multiorg" is member of following organizations: organization1, organization2, organization3
Organization: organization1
The system has been registered with ID: 259e8a85-fbc0-4a2a-84c1-4bc944eb432e
The registered system name is: localhost.localdomain
[root@localhost ~]# rpm -q subscription-manager
subscription-manager-1.29.21-1.el9.x86_64
[root@localhost ~]#

* There is a traceback in syslog:
...
10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:170] Environment variable NO_PROXY= will be used
10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:269] Connection built: host=XYZ.redhat.com port=443 handler=/subscription auth=basic username=test_user_multiorg
10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:717] Making request: GET /subscription/users/test_user_multiorg/owners
10:08:48,712 INFO rhsm-service:DEBUG [rhsm.connection:571] Loaded CA certificates from /etc/rhsm/ca/: redhat-entitlement-authority.pem, katello-server-ca.pem, redhat-uep.pem, katello-default-ca.pem
10:08:48,751 INFO rhsm-service:DEBUG [rhsm.connection:819] Response time: 0.021425247192382812, Smoothed response time: 0.021425247192382812
10:08:48,751 INFO rhsm-service:DEBUG [rhsm.connection:796] Response: status=404, request="GET /subscription/users/test_user_multiorg/owners"
10:08:48,753 INFO rhsm-service:ERROR [rhsmlib.dbus.util:73] HTTP error (404 - Not Found):
10:08:48,753 INFO rhsm-service:Traceback (most recent call last):
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsmlib/dbus/util.py", line 71, in dbus_handle_exceptions
10:08:48,753 INFO rhsm-service:    return func(*args, **kwargs)
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsmlib/dbus/objects/register.py", line 158, in GetOrgs
10:08:48,753 INFO rhsm-service:    owners = cp.getOwnerList(connection_options['username'])
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 1383, in getOwnerList
10:08:48,753 INFO rhsm-service:    owners = self.conn.request_get(method)
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 920, in request_get
10:08:48,753 INFO rhsm-service:    return self._request("GET", method, headers=headers, cert_key_pairs=cert_key_pairs)
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 945, in _request
10:08:48,753 INFO rhsm-service:    result = super(Restlib, self)._request(request_type, method,
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 805, in _request
10:08:48,753 INFO rhsm-service:    self.validateResponse(result, request_type, handler)
10:08:48,753 INFO rhsm-service:  File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 879, in validateResponse
10:08:48,753 INFO rhsm-service:    raise RestlibException(response['status'], error_msg, response.get('headers'))
10:08:48,753 INFO rhsm-service:rhsm.connection.RestlibException: HTTP error (404 - Not Found):
...

In RHEL-9.0-Beta, the call is successful:
...
10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:172] Environment variable NO_PROXY= will be used
10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:271] Connection built: host=XYZ.redhat.com port=443 handler=/rhsm auth=basic username=test_user_multiorg
10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:717] Making request: GET /rhsm/users/test_user_multiorg/owners
10:00:42,268 INFO rhsm-service:DEBUG [rhsm.connection:570] Loaded CA certificates from /etc/rhsm/ca/: katello-server-ca.pem, redhat-uep.pem, katello-default-ca.pem, redhat-entitlement-authority.pem
10:00:42,418 INFO rhsm-service:DEBUG [rhsm.connection:813] Response time: 0.02483391761779785, Smoothed response time: 0.02483391761779785
10:00:42,418 INFO rhsm-service:DEBUG [rhsm.connection:790] Response: status=200, request="GET /rhsm/users/test_user_multiorg/owners"
10:00:42,419 WARNING org.fedoraproject.Anaconda.Modules.Subscription:DEBUG:anaconda.modules.subscription.runtime:subscription: got organization data (174 characters)
...

Comment 9 Pino Toscano 2022-01-28 11:11:31 UTC
Thanks Jan & Martin for the details and the investigation.

@Jan: one question/note so far:

(In reply to Jan Stodola from comment #0)
> * There is a traceback in syslog:
> ...
> 10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:170] Environment variable NO_PROXY= will be used
> 10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:269] Connection built: host=XYZ.redhat.com port=443 handler=/subscription auth=basic username=test_user_multiorg
> 10:08:48,705 INFO rhsm-service:DEBUG [rhsm.connection:717] Making request: GET /subscription/users/test_user_multiorg/owners
> 10:08:48,712 INFO rhsm-service:DEBUG [rhsm.connection:571] Loaded CA certificates from /etc/rhsm/ca/: redhat-entitlement-authority.pem, katello-server-ca.pem, redhat-uep.pem, katello-default-ca.pem
> 10:08:48,751 INFO rhsm-service:DEBUG [rhsm.connection:819] Response time: 0.021425247192382812, Smoothed response time: 0.021425247192382812
> 10:08:48,751 INFO rhsm-service:DEBUG [rhsm.connection:796] Response: status=404, request="GET /subscription/users/test_user_multiorg/owners"
> [...]
> In RHEL-9.0-Beta, the call is successful:
> ...
> 10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:172] Environment variable NO_PROXY= will be used
> 10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:271] Connection built: host=XYZ.redhat.com port=443 handler=/rhsm auth=basic username=test_user_multiorg
> 10:00:42,262 INFO rhsm-service:DEBUG [rhsm.connection:717] Making request: GET /rhsm/users/test_user_multiorg/owners
> 10:00:42,268 INFO rhsm-service:DEBUG [rhsm.connection:570] Loaded CA certificates from /etc/rhsm/ca/: katello-server-ca.pem, redhat-uep.pem, katello-default-ca.pem, redhat-entitlement-authority.pem
> 10:00:42,418 INFO rhsm-service:DEBUG [rhsm.connection:813] Response time: 0.02483391761779785, Smoothed response time: 0.02483391761779785
> 10:00:42,418 INFO rhsm-service:DEBUG [rhsm.connection:790] Response: status=200, request="GET /rhsm/users/test_user_multiorg/owners"

Is there possibly a different configuration/setup in the two tests?
The first one (RHEL 9.0) uses a /subscription handler (which is the one used for RHSM Hosted), while the second one (RHEL 9.0-beta) uses a /rhsm handler (which is used by Satellite).
Could it be that somehow the 9.0 test is misconfigured, and tried to use a RHSM endpoint against Satellite?

Comment 10 Jan Stodola 2022-01-28 12:56:09 UTC
Good point, I can see that /etc/rhsm/rhsm.conf in the installation environment is not set properly and for example the prefix or baseurl config options are not set correctly in the latest RHEL-9.0 compose after an attempt to register.

I will upload config files from both 9.0-Beta and latest 9.0.

Martine, is it possible that the ${SATELLITE}/pub/katello-rhsm-consumer file was not executed? If I download the file from the satellite and execute it manually in the installation environment, then the prefix and baseurl options are applied correctly in /etc/rhsm/rhsm.conf

Comment 13 Jiri Hnidek 2022-02-01 11:46:04 UTC
Hi,
The D-Bus method GetOrgs() has argument connection_options. It is dictionary and it can contain several keys ('host', 'port', 'handler', 'proxy_hostname', etc). Is it possible that this dictionary is not populated with values from anaconda dialog?

I have personal repository with some testing scripts: https://github.com/jirihnidek/rhsm-dbus-examples

This example could be used for this case: https://github.com/jirihnidek/rhsm-dbus-examples/blob/main/get-list-of-orgs-connection-options.sh

Jiri

Comment 14 Rehana 2022-02-14 14:05:49 UTC
// Update 

Currently this issue is being investigated by Anaconda team. We will wait for the anaconda team to finish the investigation. Based on the discussion with the team , they will let us know if they need any additional fix from subscription-manager side.

Comment 15 Martin Kolman 2022-02-15 04:36:17 UTC
(In reply to Rehana from comment #14)
> // Update 
> 
> Currently this issue is being investigated by Anaconda team. We will wait
> for the anaconda team to finish the investigation. Based on the discussion
> with the team , they will let us know if they need any additional fix from
> subscription-manager side.

So after further investigation, this turns out to be an Anaconda side issue, so switching the component back to anaconda.

As for what actually happens in this case:

0) username + password registration attempt to a Satellite instance is started
1) the installation environment is provisioned for the Satellite instance
2) GetOrgs() is called, the output contains more than one org
3) this raises a multiple-orgs exception (you can't register a multi-org user without specifying a single org to use)
4) this exception, like any registration time exception triggers rollback of the Satellite provisioning
5) but it also tells the GUI that the current user is a multi-org user and it needs to handle that
6) the GUI just gets the exception, so it calls GetOrgs() again, to get the organization list
7) but at this point, the system is no longer provisioned for for the Satellite instance - so the call goes out to hosted Candlepin and fails!

As to why did this work on Beta and no longer works now - it looks like it was caused by fix for bug 2010865 (PR: https://github.com/rhinstaller/anaconda/pull/3651).
Before that bug was fixed, we did not roll-back Satellite provisioning after a registration failure, only on explicit unregistration. 

Therefore, the second GetOrgs() call happened in still provisioned environment and was successful.

As how to fix this - I'll have to think about it a bit, in general I think we want to get ridd of that second GetOrgs() call and forward the organization list to the GUI we get from the initial GetOrgs() call instead.

Comment 16 Martin Kolman 2022-02-23 04:56:22 UTC
PR: https://github.com/rhinstaller/anaconda/pull/3887

Comment 18 Jan Stodola 2022-02-25 16:01:12 UTC
The list of organizations is populated and it's possible to select and use one of them.

Tested with anaconda-34.25.0.27-1.el9.

Marking as Verified:Tested

Comment 21 Jan Stodola 2022-02-28 09:30:51 UTC
Checked that anaconda-34.25.0.27-1.el9 is in nightly compose RHEL-9.0.0-20220227.3

Moving to VERIFIED

Comment 23 errata-xmlrpc 2022-05-17 12:30:45 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 (new packages: anaconda), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2326


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