Project

General

Profile

Bug #10243

Error in processing salt reports

Added by Rolf Larsen about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Reports
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

After stbenjamin created a fix for one of the problems i issued (https://github.com/theforeman/foreman_salt/pull/36) i found a new one:

Action:
Actions::ForemanSalt::ReportImport
--snipping input---
Exception:
ActiveRecord::AssociationTypeMismatch: Host::Managed(#66115020) expected, got Host::Base(#61291400)
Backtrace:
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/associations/association.rb:210:in `raise_on_type_mismatch'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/associations/belongs_to_association.rb:6:in `replace'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/associations/singular_association.rb:17:in `writer'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/associations/builder/association.rb:51:in `block in define_writers'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/attribute_assignment.rb:78:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/base.rb:498:in `initialize'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:133:in `new'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:133:in `process_normal'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:36:in `import'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:10:in `block in import'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:8:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:8:in `map'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/services/foreman_salt/report_importer.rb:8:in `import'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/lib/actions/foreman_salt/report_import.rb:14:in `block in run'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:72:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:78:in `as_anonymous_admin'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-2.0.2/app/lib/actions/foreman_salt/report_import.rb:13:in `run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:456:in `block (3 levels) in execute_run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/middleware/stack.rb:26:in `call'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/middleware.rb:16:in `pass'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action/progress.rb:30:in `with_progress_calculation'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action/progress.rb:16:in `run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/middleware/stack.rb:22:in `call'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/middleware/world.rb:30:in `execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:455:in `block (2 levels) in execute_run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:454:in `catch'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:454:in `block in execute_run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:371:in `call'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:371:in `block in with_error_handling'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:371:in `catch'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:371:in `with_error_handling'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:449:in `execute_run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/action.rb:236:in `execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:9:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract.rb:152:in `call'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract.rb:152:in `with_meta_calculation'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:8:in `block in execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:22:in `open_action'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:7:in `execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/executors/parallel/worker.rb:20:in `block in on_message'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:859:in `block in assigns'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:858:in `tap'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:858:in `assigns'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:138:in `match_value'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:116:in `block in match'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:115:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/algebrick-0.4.0/lib/algebrick.rb:115:in `match'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/executors/parallel/worker.rb:17:in `on_message'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:82:in `on_envelope'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:72:in `receive'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:99:in `block (2 levels) in run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:99:in `loop'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:99:in `block in run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:99:in `catch'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:99:in `run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/dynflow-0.7.6/lib/dynflow/micro_actor.rb:13:in `block in initialize'

History

#1 Updated by Anonymous about 7 years ago

  • Project changed from Installer to Salt
  • Category set to Reports

#2 Updated by Rolf Larsen about 7 years ago

This solved my error with a salt host being imported as a Host::Base and not Host::Managed:

Thanks stbenjam!

11:46:44 < stbenjam> rofl____: the only thing i can think of is maybe change this file: 
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_salt-0.0.2/app/services/foreman_salt/report_importer.rb, on like 46 from Host::Base -> Host::Managed, and restart foreman and foreman-tasks
11:46:58 < stbenjam> rofl____: delete that host, and see how it's imported
11:48:50 < stbenjam> sory, foreman_salt-2.0.2 in that directory path

#3 Updated by Stephen Benjamin about 7 years ago

  • Status changed from New to Closed

Fixed in https://github.com/theforeman/foreman_salt/pull/36 and will be delivered as part of foreman_salt 2.1.

Also available in: Atom PDF