Problem:
Any time I try to created a new host - Oops, we’re sorry but something went wrong undefined method ‘#major’ for NilClass::Jail (NilClass) Expected outcome:
Create a new host template shows up and I can start to fill out the information. Foreman and Proxy versions:
1.16.1 Foreman and Proxy plugin versions:
not sure if this is needed. Other relevant data:
production.log
2018-05-29 11:07:16 4f1e4802 [app] [I] Completed 200 OK in 8ms (Views: 2.6ms | ActiveRecord: 0.4ms)
2018-05-29 11:07:16 229794ae [app] [I] Started GET "/hosts/new" for 10.0.40.83 at 2018-05-29 11:07:16 -0400
2018-05-29 11:07:16 229794ae [app] [I] Processing by HostsController#new as HTML
2018-05-29 11:07:16 229794ae [app] [I] Current user: staskoj (administrator)
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'add_execution_interface_js', you should change its definition to include:
| :original => 'e19abe3e364f6c120a7314f48c03fcaf71ecf10a'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'ansible_roles_tab', you should change its definition to include:
| :original => 'f234dfccee67a10906661b649c8cf0ee976e3c58'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'ansible_roles_tab_content', you should change its definition to include:
| :original => 'e19abe3e364f6c120a7314f48c03fcaf71ecf10a'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'host_form_expired_on_field', you should change its definition to include:
| :original => '342319b985028e55b9df0e7fd353cb582893e9cb'
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/_progress.html.erb (1.0ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/puppet/_main_tab_fields.html.erb (5.2ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/puppet/_puppet_classes_tab.html.erb (1.0ms)
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'add_execution_interface', you should change its definition to include:
| :original => 'dbe1da973bfb251a74b994e7ae11bc8d11502c97'
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_base_form.html.erb (30.0ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_virtual_form.html.erb (2.6ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_provider_specific_form.html.erb (0.7ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/manageds/_managed.html.erb (51.0ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_base_form.html.erb (18.5ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_virtual_form.html.erb (1.5ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/_provider_specific_form.html.erb (0.2ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered nic/manageds/_managed.html.erb (23.7ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/_interfaces.html.erb (80.3ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered common/os_selection/_architecture.html.erb (1.9ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2/app/views/hosts/provision_method/bootdisk/_form.html.erb (0.9ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered common/os_selection/_operatingsystem.html.erb (2.7ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/provision_method/build/_form.html.erb (5.8ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/provision_method/image/_form.html.erb (0.4ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/_operating_system.html.erb (19.7ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/_unattended.html.erb (20.8ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered puppetclasses/_class_parameters.html.erb (0.0ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered puppetclasses/_classes_parameters.html.erb (10.2ms)
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'add_execution_interface_js', you should change its definition to include:
| :original => 'e19abe3e364f6c120a7314f48c03fcaf71ecf10a'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'ansible_roles_tab', you should change its definition to include:
| :original => 'f234dfccee67a10906661b649c8cf0ee976e3c58'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'ansible_roles_tab_content', you should change its definition to include:
| :original => 'e19abe3e364f6c120a7314f48c03fcaf71ecf10a'
2018-05-29 11:07:16 229794ae [app] [I] Deface: [WARNING] No :original defined for 'host_form_expired_on_field', you should change its definition to include:
| :original => '342319b985028e55b9df0e7fd353cb582893e9cb'
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/_form.html.erb (263.2ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered hosts/new.html.erb within layouts/application (305.7ms)
2018-05-29 11:07:16 229794ae [app] [W] Action failed
| Safemode::NoMethodError: undefined method '#major' for NilClass::Jail (NilClass)
| /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/jail.rb:22:in `method_missing'
| /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:58:in `bind'
| /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
| /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
| /usr/share/foreman/app/services/safe_render.rb:36:in `parse_string'
| /usr/share/foreman/app/services/safe_render.rb:18:in `parse'
| /usr/share/foreman/app/models/concerns/host_params.rb:26:in `block in host_inherited_params'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
| /usr/share/foreman/app/models/concerns/host_params.rb:24:in `host_inherited_params'
| /usr/share/foreman/app/views/hosts/_form.html.erb:131:in `block (2 levels) in _245324e8c14959b19cf64700e4f315fd'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/helpers/capture_helper.rb:202:in `with_output_buffer'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/helpers/capture_helper.rb:38:in `capture'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/helpers/form_helper.rb:444:in `form_for'
| /usr/share/foreman/app/helpers/form_helper.rb:290:in `form_for'
| /usr/share/foreman/app/views/hosts/_form.html.erb:8:in `block in _245324e8c14959b19cf64700e4f315fd'
| /usr/share/foreman/app/models/taxonomy.rb:72:in `block (2 levels) in as_taxonomy'
| /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:168:in `as_location'
| /usr/share/foreman/app/models/taxonomy.rb:71:in `block in as_taxonomy'
| /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:133:in `as_org'
| /usr/share/foreman/app/models/taxonomy.rb:70:in `as_taxonomy'
| /usr/share/foreman/app/views/hosts/_form.html.erb:6:in `_245324e8c14959b19cf64700e4f315fd'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:145:in `block in render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:333:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:143:in `render'
| /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.2.0/lib/deface/action_view_extensions.rb:41:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/partial_renderer.rb:309:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/renderer.rb:51:in `render_partial'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/renderer.rb:25:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/helpers/rendering_helper.rb:32:in `render'
| /usr/share/foreman/app/views/hosts/new.html.erb:3:in `_1de0896e812ddadf5ca5eee30c4e8f22'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:145:in `block in render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:333:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/template.rb:143:in `render'
| /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.2.0/lib/deface/action_view_extensions.rb:41:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/template_renderer.rb:52:in `render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/template_renderer.rb:14:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/renderer.rb:46:in `render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/renderer/renderer.rb:27:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:100:in `_render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/streaming.rb:217:in `_render_template'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:83:in `render_to_body'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:32:in `render_to_body'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/renderers.rb:37:in `render_to_body'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/rendering.rb:25:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:16:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
| /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:303:in `realtime'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/core_ext/benchmark.rb:12:in `ms'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:43:in `render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
| /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
| /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
| /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
| /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.4.1/lib/audited/sweeper.rb:14:in `around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `public_send'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `block in make_lambda'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in `process'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in `process'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in `dispatch'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in `block in action'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in `serve'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `each'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `serve'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/static_dispatcher.rb:65:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/extractor/recorder.rb:136:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:25:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
| /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
| /usr/share/foreman/lib/middleware/session_safe_logging.rb:17:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:225:in `context'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:220:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:22:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/sprockets-rails-3.2.0/lib/sprockets/rails/quiet_assets.rb:13:in `call'
| /usr/share/foreman/lib/middleware/tagged_logging.rb:18:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/methodoverride.rb:22:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/runtime.rb:18:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/sendfile.rb:113:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-3.4.1/lib/secure_headers/middleware.rb:12:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in `block in call'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `each'
| /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `call'
| /usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
| /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
| /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
| /usr/share/passenger/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
| /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2018-05-29 11:07:16 229794ae [app] [I] Rendered common/500.html.erb within layouts/application (9.7ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered layouts/_application_content.html.erb (1.5ms)
2018-05-29 11:07:16 229794ae [app] [I] Rendered layouts/base.html.erb (3.6ms)
2018-05-29 11:07:16 229794ae [app] [I] Completed 500 Internal Server Error in 338ms (Views: 18.7ms | ActiveRecord: 11.1ms)
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
So I had a user try to create a host via an api call. The host isn’t listed as they didn’t capture all the necessary fields in the api call and it failed however it seems there is some artifacts left behind. I will try to turn on debugging but i am wondering if there is a host record in my db as this issue just started. Is there a good resource for db manipulation for foreman?
Just don’t cut/paste code into the Rails Console blindly. You have full access to everything from the console, and can easily do damage. If you’re unsure how to apply something you’ve learned, do ask
@Gwmngilfen@lzap - Hi - I’m really sorry but after running some basic queries I can’t find any traces of that host in the postgres database and trying to do some wild card searches for operating system and hosts from both foreman-rake console and just some queries in the foreman postgres db.
An update as I was typing this I discovered the issue I had created a global parameter that works in hosts groups parameters just fine but screws up creating a new host when it’s used as a global parameter.
<% if @host.shortname.include?(“xxx”) || @host.shortname.include?(“xxx”) -%>1-EL<%= @host.operatingsystem.major %>x8664Dev<% else -%>1-EL<%= @host.operatingsystem.major %>x8664Prd<% end -%>
I use the redhat_register snippet in my kickstart and have a parameter for activation_key. If I set it in the global parameters outside of the hostgroups just this way <% if @host.shortname.include?(“xxx”) || @host.shortname.include?(“xxx”) -%>1-EL<%= @host.operatingsystem.major %>x8664Dev<% else -%>1-EL<%= @host.operatingsystem.major %>x8664Prd<% end -%>
it creates the error from the start of this post.
If I set it at the hostgroup layer it works fine. I apologize if you are asking for something specifically I don’t know how to answer it without a bit more context.
What is the value set for option “Safemode rendering” under Administer -> Settings -> Provisioning tab ?
Could you please try by disabling this option and let us know result.
TemplateWriting - Foreman this is document on Template Writing. Please ensure syntax from this document.
How you are accessing global parameters in a snippet ?
For example, global parameter -> abc = ‘Hello’
You can access this parameter in snippet as @host.params[‘abc’]. Please confirm you are using it in a similar way.
I will reply back to the safemode rendering but specifically all I do is include the the default redhat_register snippet in the kickstart and set my activation_key. I would assume disabling safemode render will bypass this because that is where it is failing. But I will post back later with the results.
Sorry for repeating some of what was already asked but I’m trying to understand the connection to the global parameter for activation key, the template and the error to see which part causes it.
Does the error happen when attempting to save the new host or before that?
Does the parameter show up on the parameters tab when creating the host?
Is this: <% if @host.shortname.include?(“xxx”) || @host.shortname.include?(“xxx”) -%>1-EL<%= @host.operatingsystem.major %>x8664Dev<% else -%>1-EL<%= @host.operatingsystem.major %>x8664Prd<% end -%>
part of one of the templates or a parameter?
The parameter works in hostgroup so it evaluates correctly in hostgroup?
Or does that mean if you set it as a hostgroup parameter instead of a global parameter?
If the second question is correct - did you set an operating system on the hostgroup?
It looks like what @Gwmngilfen suspected - the evaluation of the global parameter seems to be very early.
Once you try to create the host it gets the value of all host parameters - when nothing has been selected that means all the global parameters that exist.
The global parameter tries to evaluate something that doesn’t exist yet.
For now it seems you found a workaround - applying it on the hostgroup level.
Another option is to change @host.operatingsystem.major to @host.operatingsystem.try(:major) or add an if there before using it.
This needs to be investigated to see if it’s evaluating in the right place (in which case the “if” or “try” is needed in any parameter that tries to access the host details) or if there is a bug here.