Bug #22684
closedBootdisk method does not inherit disk layout from hostgroup
Description
When trying to use provisioning template preview, an exception is raised.
This happens regardless of the existence of a host.
Last upstream commit that I'm on: 74f5ebf
| NoMethodError: undefined method `layout' for nil:NilClass | /home/ik/projects/foreman/app/models/host/managed.rb:319:in `diskLayout' | /home/ik/.rvm/gems/ruby-2.3.4/gems/safemode-1.3.4/lib/safemode/jail.rb:31:in `method_missing' | Kickstart default:194:in `bind' | /home/ik/.rvm/gems/ruby-2.3.4/gems/safemode-1.3.4/lib/safemode.rb:51:in `eval' | /home/ik/.rvm/gems/ruby-2.3.4/gems/safemode-1.3.4/lib/safemode.rb:51:in `eval' | /home/ik/projects/foreman/lib/foreman/renderer.rb:128:in `render_safe' | /home/ik/projects/foreman/lib/foreman/renderer.rb:246:in `unattended_render' | /home/ik/projects/foreman/app/controllers/templates_controller.rb:115:in `safe_render' | /home/ik/projects/foreman/app/controllers/templates_controller.rb:96:in `preview' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:186:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/rendering.rb:30:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:20:in `block in process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:108:in `block in run_callbacks' | /home/ik/projects/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks' | /home/ik/projects/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks' | /home/ik/projects/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks' | /home/ik/.rvm/gems/ruby-2.3.4/gems/audited-4.6.0/lib/audited/sweeper.rb:14:in `around' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks' | /home/ik/.rvm/gems/ruby-2.3.4/gems/audited-4.6.0/lib/audited/sweeper.rb:14:in `around' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:135:in `run_callbacks' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:19:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/rescue.rb:20:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `block in instrument' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `instrument' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:30:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal/params_wrapper.rb:252:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/railties/controller_runtime.rb:22:in `process_action' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:124:in `process' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionview-5.1.4/lib/action_view/rendering.rb:30:in `process' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal.rb:189:in `dispatch' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_controller/metal.rb:253:in `dispatch' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:49:in `dispatch' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:31:in `serve' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:in `block in serve' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `each' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `serve' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/apipie-rails-0.5.6/lib/apipie/static_dispatcher.rb:65:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/bullet-5.7.1/lib/bullet/rack.rb:12:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/apipie-rails-0.5.6/lib/apipie/extractor/recorder.rb:136:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/apipie-rails-0.5.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call' | /home/ik/projects/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/etag.rb:25:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/conditional_get.rb:38:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/head.rb:12:in `call' | /home/ik/projects/foreman/lib/middleware/session_safe_logging.rb:17:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:232:in `context' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:226:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/cookies.rb:613:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/migration.rb:556:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:26:in `block in call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:97:in `run_callbacks' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:24:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/rack/logger.rb:36:in `call_app' | /home/ik/.rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/rack/logger.rb:26:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call' | /home/ik/projects/foreman/lib/middleware/tagged_logging.rb:18:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/runtime.rb:22:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:125:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/secure_headers-3.7.3/lib/secure_headers/middleware.rb:12:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send' | /home/ik/.rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:68:in `block in call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `each' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `call' | /home/ik/projects/foreman/lib/foreman/telemetry_rack.rb:9:in `call' | /home/ik/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/handler/webrick.rb:86:in `service' | /home/ik/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service' | /home/ik/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run' | /home/ik/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread' | /home/ik/.rvm/gems/ruby-2.3.4/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
Updated by Marek Hulán almost 7 years ago
does your host have partition table assigned? the error message is not very helpful, but most likely the host does not have everything assigned correctly
Updated by Ido Kanner almost 7 years ago
Marek Hulán wrote:
does your host have partition table assigned? the error message is not very helpful, but most likely the host does not have everything assigned correctly
It looks like the host have partition table (kickstart default).
On a forklift copy that I have, the issue does not happen, it has more plugins and also katello, so I'm trying to figure it out.
Updated by Marek Hulán almost 7 years ago
Make sure the partition table is in right org/loc, especially if you enabled orgs/locs later than when you seeded the DB
Updated by Lukas Zapletal almost 6 years ago
- Subject changed from When doing a preview on a provision template, there is an exception undefined method `layout' for nil:NilClass to Bootdisk method does not inherit disk layout from hostgroup
- Category set to Host creation
- Assignee set to Lukas Zapletal
- Found in Releases 1.22.0 added
This problem can be caused:
- By incorrect taxonomy of the partition table.
- By setting partition table to blank value on a host.
- By setting bootdisk provision method which causes `pxe_build?` to return false.
Updated by Lukas Zapletal almost 6 years ago
- Difficulty set to medium
- Triaged changed from No to Yes
- Bugzilla link set to 1597208
Updated by Lukas Zapletal almost 6 years ago
- Related to Refactor #25680: Allow plugins to override validate_media? added
Updated by The Foreman Bot almost 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6516 added
Updated by Lukas Zapletal almost 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 7476d397deeaa69e18d546fa71bc694ca5240b53.