Project

General

Profile

Bug #22684

Bootdisk method does not inherit disk layout from hostgroup

Added by Ido Kanner about 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Host creation
Target version:
-
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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'

Related issues

Related to Foreman - Refactor #25680: Allow plugins to override validate_media?Closed

Associated revisions

Revision 7476d397 (diff)
Added by Lukas Zapletal about 4 years ago

Fixes #22684 - host creation is bootdisk method friendly

History

#1 Updated by Marek Hulán about 5 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

#2 Updated by Ido Kanner about 5 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.

#3 Updated by Marek Hulán about 5 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

#4 Updated by Lukas Zapletal about 4 years ago

  • Assignee set to Lukas Zapletal
  • Category set to Host creation
  • 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
  • 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.

#5 Updated by Lukas Zapletal about 4 years ago

  • Bugzilla link set to 1597208
  • Triaged changed from No to Yes
  • Difficulty set to medium

#6 Updated by Lukas Zapletal about 4 years ago

  • Related to Refactor #25680: Allow plugins to override validate_media? added

#7 Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6516 added

#8 Updated by Timo Goebel about 4 years ago

  • Fixed in Releases 1.22.0 added

#9 Updated by Lukas Zapletal about 4 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF