Project

General

Profile

Actions

Bug #36137

closed

Can't update host with Katello plugin installed

Added by Oleh Fedorenko almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

I'm going to set priority to Urgent since this bug makes a host update process unusable via WebUI (didn't check API though).

Problem:
When trying to edit a host with e.g content view it fails on submit with error [0].

Steps to reproduce:
1. Create a hostgroup <group>, attach content view (probably lifecycle environment as well)
2. Create a host <host> under <group> hostgroup
3. Navigate to Hosts > Edit <host>
4. Try to click submit even without any changes

Additional notes:
I think it's due to recent changes related to single_content_view and simple overlook that a hostgroup can have such attributes and a host will automatically inherit them.
I've checked which params are going into controller and they are fine since Katello deletes "broken" params [1]. But since hostgroup is still present it tries to apply inherited attributes [2].
The solution is probably lies in fixing [3], but I'm not so sure.

[0] -
ActiveModel::UnknownAttributeError (unknown attribute 'content_view_id' for Katello::Host::ContentFacet.):
16:33:22 rails.1 | 3f328660 |
16:33:22 rails.1 | 3f328660 | app/controllers/hosts_controller.rb:117:in `block in update'
16:33:22 rails.1 | 3f328660 | app/models/taxonomy.rb:73:in `block in no_taxonomy_scope'
16:33:22 rails.1 | 3f328660 | app/models/taxonomy.rb:80:in `block (2 levels) in as_taxonomy'
16:33:22 rails.1 | 3f328660 | app/models/concerns/foreman/thread_session.rb:195:in `as_location'
16:33:22 rails.1 | 3f328660 | app/models/taxonomy.rb:79:in `block in as_taxonomy'
16:33:22 rails.1 | 3f328660 | app/models/concerns/foreman/thread_session.rb:154:in `as_org'
16:33:22 rails.1 | 3f328660 | app/models/taxonomy.rb:78:in `as_taxonomy'
16:33:22 rails.1 | 3f328660 | app/models/taxonomy.rb:72:in `no_taxonomy_scope'
16:33:22 rails.1 | 3f328660 | app/controllers/hosts_controller.rb:114:in `update'
16:33:22 rails.1 | 3f328660 | app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
16:33:22 rails.1 | 3f328660 | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
16:33:22 rails.1 | 3f328660 | app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
16:33:22 rails.1 | 3f328660 | /home/vagrant/katello/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
16:33:22 rails.1 | 3f328660 | /home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in `call'
16:33:22 rails.1 | 3f328660 | lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
16:33:22 rails.1 | 3f328660 | lib/foreman/middleware/telemetry.rb:10:in `call'
16:33:22 rails.1 | 3f328660 | lib/foreman/middleware/logging_context_session.rb:22:in `call'
16:33:22 rails.1 | 3f328660 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
16:33:22 rails.1 | 3f328660 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call'

[1] - https://github.com/Katello/katello/blob/master/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb#L10
[2] - https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L537
[3] - https://github.com/Katello/katello/blob/master/app/models/katello/host/content_facet.rb#L339

Actions

Also available in: Atom PDF