Bug #21438
closedCan't register content host
Description
2017-10-23T18:26:18 6628d969 [app] [I] Started GET "/rhsm/owners/Default_Organization/environments?name=Library" for 127.0.0.1 at 2017-10-23 18:26:18 +0000
2017-10-23T18:26:18 6628d969 [app] [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#rhsm_index as JSON
2017-10-23T18:26:18 6628d969 [app] [I] Parameters: {"name"=>"Library", "organization_id"=>"Default_Organization"}
2017-10-23T18:26:18 6628d969 [app] [I] Current user: foreman_admin (administrator)
2017-10-23T18:26:18 6628d969 [app] [D] Setting current user thread-local variable to foreman_admin
2017-10-23T18:26:18 6628d969 [app] [D] Setting current user thread-local variable to nil
2017-10-23T18:26:18 6628d969 [katello/cp_proxy] [I] Authorized user admin(Admin User)
2017-10-23T18:26:18 6628d969 [app] [I] Current user: admin (administrator)
2017-10-23T18:26:18 6628d969 [app] [D] Setting current user thread-local variable to admin
2017-10-23T18:26:19 6628d969 [app] [I] Filter chain halted as :authorize rendered or redirected
2017-10-23T18:26:19 6628d969 [app] [I] Completed 404 Not Found in 1128ms (Views: 0.6ms | ActiveRecord: 6.0ms)
2017-10-23T18:26:19 6628d969 [app] [D] With body: {"message"=>"Organization with id Default_Organization not found", "displayMessage"=>"Organization with id Default_Organization not found"}
|
git bisect narrows down the issue to foreman commit f17c9611cb16f949fb178fe3de2aabd231e0de5b
Updated by Justin Sherrill about 7 years ago
for some reason, this: https://github.com/Katello/katello/blob/master/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L28
does not seem to be working.
Updated by Marek Hulán about 7 years ago
John, this seems to be log from the developer setup, are you sure you have https://github.com/Katello/katello/commit/1832568fa5178376fb8f08b1a1ed0886bff5fb78 (https://github.com/Katello/katello/pull/7008) applied?
Updated by Marek Hulán about 7 years ago
I was able to reproduce, will continue investigating.
Updated by Marek Hulán about 7 years ago
- Related to Bug #21357: Change the way how default taxonomy is derived added
Updated by Marek Hulán about 7 years ago
- Assignee set to Marek Hulán
- Target version set to 1.16.0-RC1
The issue is that after user login we call set_taxonomy directly since we want to set the proper context. The skip_before_action works but it fails even before that. The problem cause is that in this controller, organization_id parameter is organization label. I suppose we won't change subscription manager so the best solution I could think of is adding new before action that executes before any other action and converts the label to id and saves it into params. That way set_taxonomy can still be used and later in this controller actions we can rely on Organization.current. The conversion should be done by existing #find_organization Katello method.
There's also another hack, that overrides params[:organization_id] with params[:owner], that does not need to be changed since that happens after set_taxonomy is called. I'm not entirely sure what that's needed.
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/7026 added
Updated by Justin Sherrill about 7 years ago
- Translation missing: en.field_release set to 284
Updated by Marek Hulán about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|3ab3dae52b875debabaab1a6bbe64b854d46cf68.