Bug 1934190

Summary: Configure Cloud Connector doesn't work when non-default organization is selected
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: RH Cloud - Cloud ConnectorAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: high    
Version: 6.9.0CC: ahumbe, aruzicka, pcreech, sshtein
Target Milestone: 6.9.0Keywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.0.18 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:11: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:

Description Lukáš Hellebrandt 2021-03-02 16:45:57 UTC
Description of problem:
In WebUI, when I select some organization as active other than default, I get a red notification with error "Cloud connector setup has failed: Error: Request failed with status code 404" and the following traceback:

    ==> /var/log/foreman/production.log <==
    2021-02-25T11:24:49 [I|app|02ea1088] Started POST "/foreman_inventory_upload/cloud_connector" for 127.0.0.1 at 2021-02-25 11:24:49 -0500
    2021-02-25T11:24:49 [I|app|02ea1088] Processing by ForemanInventoryUpload::UploadsController#enable_cloud_connector as JSON
    2021-02-25T11:24:49 [I|app|02ea1088]   Parameters: {"upload"=>{}}
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (1) destroy event on name Cloud connector access token
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (1) destroy event on expires_at
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (1) destroy event on last_used_at
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (1) destroy event on revoked false
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (1) destroy event on user_id 6
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (2) create event on name Cloud connector access token
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (2) create event on expires_at
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (2) create event on last_used_at
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (2) create event on revoked false
    2021-02-25T11:24:49 [I|aud|02ea1088] PersonalAccessToken (2) create event on user_id 6
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendering common/404.html.erb within layouts/application
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendered common/404.html.erb within layouts/application (Duration: 6.4ms | Allocations: 6757)
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendered layouts/_application_content.html.erb (Duration: 3.0ms | Allocations: 6536)
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendering layouts/base.html.erb
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-7.0.1.5/app/views/foreman_theme_satellite/_theme_client_side_branding.js.erb (Duration: 3.2ms | Allocations: 6925)
    2021-02-25T11:24:49 [I|app|02ea1088]   Rendered layouts/base.html.erb (Duration: 9.4ms | Allocations: 16247)
    2021-02-25T11:24:49 [I|app|02ea1088] Completed 404 Not Found in 131ms (Views: 22.7ms | ActiveRecord: 17.5ms | Allocations: 61189)
    2021-02-25T11:24:49 [I|app|0417d17f] Started GET "/notification_recipients" for 127.0.0.1 at 2021-02-25 11:24:49 -0500
    2021-02-25T11:24:49 [I|app|0417d17f] Processing by NotificationRecipientsController#index as JSON
    2021-02-25T11:24:49 [I|app|0417d17f] Completed 200 OK in 7ms (Views: 0.2ms | ActiveRecord: 0.8ms | Allocations: 2165)
 

Version-Release number of selected component (if applicable):
Reproduced on Sat 6.9 snap 15, new feature

How reproducible:
Deterministic

Steps to Reproduce:
1. Have a clean Satellite
2. Create a new org
3. In the top left, select the new org
4. Configure -> Inventory Upload -> Configure Cloud Connector

Actual results:
No job started, notification with 404

Expected results:
Configure Cloud Connector started

Additional info:
Feature added in bug 1924592

Comment 1 Lukáš Hellebrandt 2021-03-15 16:42:53 UTC
Verified with Sat 6.9 snap 17. Using reproducer from OP, the cloud connector gets properly installed for all the applicable organizations.

Comment 4 errata-xmlrpc 2021-04-21 13:11:17 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 (Moderate: Satellite 6.9 Release), 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/RHSA-2021:1313