Bug #18630

Cannot change from synced to non-synced OS

Added by Daniel Lobato Garcia 10 months ago. Updated 6 months ago.

Status:Resolved
Priority:Normal
Assigned To:Andrew Kofink
Category:Hosts
Target version:Team Brad - Iteration 16
Difficulty: Pull request:
Bugzilla link:
Story points-
Velocity based estimate-
ReleaseKatello 3.4.1Release relationshipAuto

Description

On the Host page I see a problem where:

1st - I choose a hostgroup with an OS that is synced as a product (RHEL)
2nd - I decide to choose a different OS (not synced, one from the Foreman OS list)
3rd - This doesn't seem to work and on the logs I see:

| ActiveModel::ForbiddenAttributesError - ActiveModel::ForbiddenAttributesError:
 |   activemodel (4.2.7.1) lib/active_model/forbidden_attributes_protection.rb:21:in `sanitize_for_mass_assignment'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:33:in `assign_attributes'
 |   activerecord (4.2.7.1) lib/active_record/core.rb:566:in `init_attributes'
 |   activerecord (4.2.7.1) lib/active_record/core.rb:281:in `initialize'
 |   activerecord (4.2.7.1) lib/active_record/inheritance.rb:61:in `new'
 |   activerecord (4.2.7.1) lib/active_record/inheritance.rb:61:in `new'
 |   activerecord (4.2.7.1) lib/active_record/reflection.rb:141:in `build_association'
 |   activerecord (4.2.7.1) lib/active_record/associations/association.rb:250:in `build_record'
 |   activerecord (4.2.7.1) lib/active_record/associations/singular_association.rb:29:in `build'
 |   activerecord (4.2.7.1) lib/active_record/associations/builder/singular_association.rb:18:in `build_content_facet'
 |   activerecord (4.2.7.1) lib/active_record/nested_attributes.rb:398:in `assign_nested_attributes_for_one_to_one_association'
 |   activerecord (4.2.7.1) lib/active_record/nested_attributes.rb:343:in `content_facet_attributes='
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:54:in `public_send'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:65:in `block in assign_nested_parameter_attributes'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:65:in `each'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:65:in `assign_nested_parameter_attributes'
 |   activerecord (4.2.7.1) lib/active_record/attribute_assignment.rb:45:in `assign_attributes'
 |   activerecord (4.2.7.1) lib/active_record/core.rb:566:in `init_attributes'
 |   activerecord (4.2.7.1) lib/active_record/core.rb:281:in `initialize'
 |   app/models/host/base.rb:76:in `initialize'
 |   actionpack (4.2.7.1) lib/action_dispatch/routing/url_for.rb:104:in `initialize'
 |   app/models/host/managed.rb:49:in `initialize'
 |   activerecord (4.2.7.1) lib/active_record/inheritance.rb:61:in `new'
 |   activerecord (4.2.7.1) lib/active_record/inheritance.rb:61:in `new'
 |   app/models/concerns/foreman/sti.rb:22:in `new_with_cast'
 |   app/models/host.rb:15:in `method_missing'
 |   app/controllers/concerns/foreman/controller/host_details.rb:50:in `block in assign_parameter'
 |   app/models/taxonomy.rb:71:in `block (2 levels) in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:147:in `as_location'
 |   app/models/taxonomy.rb:70:in `block in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:112:in `as_org'
 |   app/models/taxonomy.rb:69:in `as_taxonomy'
 |   app/controllers/concerns/foreman/controller/host_details.rb:49:in `assign_parameter'
 |   app/controllers/concerns/foreman/controller/host_details.rb:12:in `o

After inspecting the parameters being sent using pry, I noticed something interesting, if I took the ActiveController::Parameters object and try to do Host.new(host_params), it would not work. If I tried to create a host manually with Host.new(manuallyinputtedparams) it worked. These are the params in question, they just don't seem to be filtered through host_params.

 {"architecture_id"=>"1",
 "hostgroup_id"=>"4",
 "location_id"=>"2",
 "medium_id"=>"",
 "operatingsystem_id"=>"8",
 "organization_id"=>"4",
 "type"=>"Host::Managed",
 "puppet_proxy_id"=>1,
 "puppet_ca_proxy_id"=>1,
 "environment_id"=>1,
 "compute_profile_id"=>nil,
 "realm_id"=>nil,
 "content_facet_attributes"=>
  {"kickstart_repository_id"=>28, "content_view_id"=>4, "lifecycle_environment_id"=>5, "content_source_id"=>1}}

Related issues

Related to Katello - Bug #18899: [Katello 3.3] Failing to register new hosts using bootstr... Resolved 03/14/2017

History

#1 Updated by Justin Sherrill 10 months ago

  • Category set to Hosts
  • Assigned To set to Partha Aji
  • Target version set to Team Tom - iteration 11
  • Release set to Katello 3.4.0

#2 Updated by Justin Sherrill 10 months ago

  • Release changed from Katello 3.4.0 to Katello 3.3.1

#3 Updated by Eric Helms 10 months ago

  • Release changed from Katello 3.3.1 to Katello 3.3.2

#4 Updated by Eric Helms 9 months ago

  • Related to Bug #18899: [Katello 3.3] Failing to register new hosts using bootstrap.py added

#5 Updated by Justin Sherrill 7 months ago

  • Release changed from Katello 3.3.2 to Katello 3.4.1

#6 Updated by Justin Sherrill 7 months ago

  • Assigned To changed from Partha Aji to Andrew Kofink

#7 Updated by Justin Sherrill 7 months ago

  • Target version changed from Team Tom - iteration 11 to Team Brad - Iteration 15

#8 Updated by Brad Buckingham 6 months ago

  • Target version changed from Team Brad - Iteration 15 to Team Brad - Iteration 16

#9 Updated by Eric Helms 6 months ago

  • Release changed from Katello 3.4.1 to Katello 3.4.2

#10 Updated by Andrew Kofink 6 months ago

  • Status changed from New to Resolved

This seems to be fixed in 3.4. If you run into the issue after updating to 3.4, please comment and reopen the issue.

#11 Updated by Eric Helms 6 months ago

  • Release changed from Katello 3.4.2 to Katello 3.4.1

Also available in: Atom PDF