theforeman / foreman_default_hostgroup

A plugin to set the default hostgroup when hosts are created.
GNU General Public License v3.0
11 stars 29 forks source link

Ruby Crash on Foreman 1.5.0 RC2 #7

Closed natewalck closed 8 years ago

natewalck commented 10 years ago

Getting the following on Foreman 1.5.0 RC2 (After the importHostsAndFacts name change)

undefined method `find_by_label' for #<Class:0x7fd1c2584cb0> (NoMethodError)
/usr/share/foreman/vendor/ruby/1.8/gems/activerecord-3.2.17/lib/active_record/dynamic_matchers.rb:27:in `method_missing'
/usr/share/foreman/vendor/ruby/1.8/gems/foreman_default_hostgroup-1.1.0/lib/default_hostgroup_managed_host_patch.rb:55:in `valid_hostgroup?'
/usr/share/foreman/vendor/ruby/1.8/gems/foreman_default_hostgroup-1.1.0/lib/default_hostgroup_managed_host_patch.rb:17:in `import_host_and_facts'
/usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:151:in `facts'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/abstract_controller/base.rb:167:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/rendering.rb:10:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/abstract_controller/callbacks.rb:18:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:461:in `_run__1721735621__process_action__1292579094__callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:215:in `_conditional_callback_around_6386'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:326:in `around'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:310:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:310:in `_callback_around_5321'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_6386'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:438:in `_run__1721735621__process_action__1292579094__callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:215:in `_conditional_callback_around_6385'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_6385'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:404:in `_run__1721735621__process_action__1292579094__callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:215:in `_conditional_callback_around_6384'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:326:in `around'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:310:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:310:in `_callback_around_13'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_6384'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:403:in `_run__1721735621__process_action__1292579094__callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/abstract_controller/callbacks.rb:17:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/rescue.rb:29:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/notifications.rb:123:in `instrument'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/notifications.rb:123:in `instrument'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/activerecord-3.2.17/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/abstract_controller/base.rb:121:in `process'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/abstract_controller/rendering.rb:45:in `process'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal.rb:203:in `dispatch'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_controller/metal.rb:246:in `action'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/routing/route_set.rb:73:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/routing/route_set.rb:36:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/routing/mapper.rb:43:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:68:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/usr/share/foreman/vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/routing/route_set.rb:608:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/apipie-rails-0.1.3/lib/apipie/static_dispatcher.rb:65:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/apipie-rails-0.1.3/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/head.rb:14:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/flash.rb:242:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/cookies.rb:341:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/activerecord-3.2.17/lib/active_record/query_cache.rb:64:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `_run__1008676751__call__4__callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/rack/logger.rb:32:in `call_app'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/rack/logger.rb:16:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/tagged_logging.rb:22:in `tagged'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/rack/logger.rb:16:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.17/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/static.rb:63:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/engine.rb:484:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/application.rb:231:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `send'
/usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `call'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
/usr/share/foreman/vendor/ruby/1.8/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:448:in `start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:442:in `initialize'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:442:in `new'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:442:in `start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:441:in `times'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:441:in `start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:440:in `synchronize'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:440:in `start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:205:in `main_loop'
/usr/share/passenger/helper-scripts/rack-preloader.rb:161
  Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (1.1ms)
Completed 500 Internal Server Error in 354.6ms (Views: 2.5ms | ActiveRecord: 26.4ms)
GregSutcliffe commented 10 years ago

I committed babf9cff708abd3b39b8f42d1ea7552ca7c74e06 a while back to fix this, see if latest develop works for you?

mmoll commented 8 years ago

can this get closed?

natewalck commented 8 years ago

Feel free to close this. I am not in this environment anymore, so I cannot test if it is fixed in 1.5.x.