Problem:
When attempting to download a Host Image or Full Host Image for a new Ubuntu 22.04 Host, I get the error: undefined method `medium_uri’ for nil:NilClass
Expected outcome:
Host Image/Full Host Image downloads successfully
Foreman and Proxy versions:
Foreman version: 3.8.0
Foreman and Proxy plugin versions:
- foreman-tasks 8.3.3
- foreman_ansible 12.0.7
- foreman_bootdisk 21.0.4
- foreman_discovery 22.0.4
- foreman_puppet 6.0.1
- foreman_remote_execution 11.1.1
- foreman_setup 8.0.1
- foreman_templates 9.4.0
Distribution and version:
AlmaLinux 8.9
Other relevant data:
This is a new Foreman server. I am attempting to replace our old Foreman server (which I did not set up, and hardly ever used).
Restrictions/situation:
- I need to deploy Ubuntu 22.04
- I need to use PXE-less provisioning with a boot disk. Our network admins can’t/won’t set up PXE booting.
- I’ve created an Installation media for Ubuntu 22.04 using an NFS share, rather than the standard recommended web path from the manual, because this Foreman was set up without Katello (the previous Foreman admin says Katello wasn’t needed). Setting up an NFS share on our SAN seemed a lot easier than trying to re-jig Foreman to properly host the files via https, or setting up a whole new webserver.
- The manual said “Ensure the path in /pub/ matches the path in your Preseed default PXELinux Autoinstall template.” I don’t know how to do this, and this is probably the source of the problem.
Here’s some additional error output:
[root@sys-fore-0p03 foreman_media]# foreman-rake errors:fetch_log request_id=d4472a20
Foreman version: 3.8.0
Plugins:
- foreman-tasks 8.3.3
- foreman_ansible 12.0.7
- foreman_bootdisk 21.0.4
- foreman_discovery 22.0.4
- foreman_puppet 6.0.1
- foreman_remote_execution 11.1.1
- foreman_setup 8.0.1
- foreman_templates 9.4.0
2024-01-09T11:33:47 [I|app|d4472a20] Started GET "/disks/full_hosts/2" for 142.207.95.82 at 2024-01-09 11:33:47 -0800
2024-01-09T11:33:47 [I|app|d4472a20] Processing by ForemanBootdisk::DisksController#full_host as HTML
2024-01-09T11:33:47 [I|app|d4472a20] Parameters: {"id"=>"2"}
2024-01-09T11:33:47 [W|app|d4472a20] Could not find a provider for sys-test-0d01.unbc.ca. Providers returned {"MediumProviders::Default"=>["Invalid medium 'Ubuntu mirror' for 'Ubuntu 22.04.3'"]}
2024-01-09T11:33:47 [W|app|d4472a20] undefined method `medium_uri' for nil:NilClass
2024-01-09T11:33:47 [I|app|d4472a20] Backtrace for 'undefined method `medium_uri' for nil:NilClass' error (NoMethodError): undefined method `medium_uri' for nil:NilClass
d4472a20 | /usr/share/foreman/app/models/operatingsystems/debian.rb:19:in `preseed_path'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables/base.rb:14:in `preseed_path'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables/base.rb:82:in `preseed_attributes'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables/base.rb:30:in `load_variables_base'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables.rb:20:in `block in load_variables'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables.rb:18:in `each'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/variables.rb:18:in `load_variables'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/base.rb:30:in `initialize'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer/scope/template.rb:9:in `initialize'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer.rb:39:in `new'
d4472a20 | /usr/share/foreman/app/services/foreman/renderer.rb:39:in `get_scope'
d4472a20 | /usr/share/gems/gems/foreman_bootdisk-21.0.4/app/services/foreman_bootdisk/renderer.rb:11:in `render_template'
d4472a20 | /usr/share/gems/gems/foreman_bootdisk-21.0.4/app/services/foreman_bootdisk/iso_generator.rb:44:in `render_template'
d4472a20 | /usr/share/gems/gems/foreman_bootdisk-21.0.4/app/services/foreman_bootdisk/iso_generator.rb:18:in `generate_full_host'
d4472a20 | /usr/share/gems/gems/foreman_bootdisk-21.0.4/app/controllers/foreman_bootdisk/disks_controller.rb:58:in `full_host'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
d4472a20 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
d4472a20 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
d4472a20 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
d4472a20 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
d4472a20 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
d4472a20 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
d4472a20 | /usr/share/gems/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:190:in `dispatch'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:254:in `dispatch'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:33:in `serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/mapper.rb:49:in `serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
d4472a20 | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
d4472a20 | /usr/share/gems/gems/apipie-rails-1.2.2/lib/apipie/static_dispatcher.rb:68:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
d4472a20 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
d4472a20 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
d4472a20 | /usr/share/gems/gems/apipie-rails-1.2.2/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/tempfile_reaper.rb:15:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/etag.rb:27:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/conditional_get.rb:27:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
d4472a20 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:266:in `context'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:260:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/cookies.rb:697:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:37:in `call_app'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:28:in `call'
d4472a20 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
d4472a20 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
d4472a20 | /usr/share/gems/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/method_override.rb:24:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/runtime.rb:22:in `call'
d4472a20 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/sendfile.rb:110:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
d4472a20 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
d4472a20 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
d4472a20 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:74:in `block in call'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `each'
d4472a20 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `call'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/configuration.rb:270:in `call'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/request.rb:100:in `block in handle_request'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/thread_pool.rb:344:in `with_force_shutdown'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/request.rb:99:in `handle_request'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/server.rb:443:in `process_client'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/server.rb:245:in `block in run'
d4472a20 | /usr/share/gems/gems/puma-6.3.1/lib/puma/thread_pool.rb:151:in `block in spawn_thread'
d4472a20 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-01-09T11:33:47 [I|app|d4472a20] Rendered common/500.html.erb within layouts/application (Duration: 6.2ms | Allocations: 1539)
2024-01-09T11:33:47 [I|app|d4472a20] Rendered layouts/base.html.erb (Duration: 7.0ms | Allocations: 4040)
2024-01-09T11:33:47 [I|app|d4472a20] Rendered layout layouts/application.html.erb (Duration: 16.4ms | Allocations: 6716)
2024-01-09T11:33:47 [I|app|d4472a20] Completed 500 Internal Server Error in 181ms (Views: 23.0ms | ActiveRecord: 37.0ms | Allocations: 24747)