Project

General

Profile

Bug #21438

Can't register content host

Added by John Mitsch almost 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

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


Related issues

Related to Katello - Bug #21357: Change the way how default taxonomy is derivedClosed2017-10-17

Associated revisions

Revision 3ab3dae5 (diff)
Added by Marek Hulán almost 4 years ago

Fixes #21438 - convert org label so set_taxonomy can use it

History

#2 Updated by Marek Hulán almost 4 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?

#3 Updated by Marek Hulán almost 4 years ago

I was able to reproduce, will continue investigating.

#4 Updated by Marek Hulán almost 4 years ago

  • Related to Bug #21357: Change the way how default taxonomy is derived added

#5 Updated by Marek Hulán almost 4 years ago

  • Target version set to 1.16.0-RC1
  • Assignee set to Marek Hulán

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.

#6 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7026 added

#7 Updated by Marek Hulán almost 4 years ago

  • Bugzilla link set to 1505639

#8 Updated by Justin Sherrill almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 284

#9 Updated by Marek Hulán almost 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF