Why does provisioning fail after upgrading to Red Hat Satellite 6.3?
Environment
- Red Hat Satellite 6.3.
- Custom templates cloned on Red Hat Satellite 6.2 before upgrade to 6.3.
Issue
-
Why do attempts to provision a host result in the installer failing to retrieve the kickstart file after upgrading to Red Hat Satellite 6.3?
dracut-initqueue[807]: curl: (22) The requeseted URL returned error: 500 Internal Server Error dracut-initqueue[807]: Warning: anaconda: failed to fetch kickstart from http://capsule.example.com/unattended/provision?token=32b5b3d6-cf6b-479d-a4b6-0a93258ebe96
Resolution
-
Please modify any custom templates to follow the same syntax as the Red Hat Satellite 6.3 default templates.
-
Find and locate any code using syntax
(&:foo)and modify the code to read{ |item| item.foo }.
For example, if you cloned a template from the default "Satellite Kickstart Default" template, in thenetworkline replace(&:present?)with{ |item| item.present? }:network [...] --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select(&:present?).join(',')}" %> [...]change to:
network [...] --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')}" %> [...]
-
-
This issue was tracked in Red Hat Bugzilla This content is not included.1482060.
For more KB articles/solutions related to Red Hat Satellite 6.x Provisioning Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Provisioning related Issues
Root Cause
- There were changes in the
safemodeRuby library used for safe evaluation of the templates. - The default templates in Red Hat Satellite 6.3 is shipped with the required syntax changes but any templates cloned whilst on Red Hat Satellite 6.2 will need equivalent changes to allow for successful rendering.
Diagnostic Steps
-
Log file
/var/log/foreman/production.login the Red Hat Satellite shows the following error when the host requests the kickstart profile ("There was an error rendering the <custom_template_name> template:"):2018-03-15 11:48:59 32243049 [app] [I] Started GET "/unattended/provision?token=+FILTERED+ for capsule.example.com at 2018-03-15 11:48:59 +0000 2018-03-15 11:48:59 32243049 [app] [I] Processing by UnattendedController#host_template as TEXT 2018-03-15 11:48:59 32243049 [app] [I] Parameters: {"token"=+FILTERED+ "url"=>"http://capsule.example.com:8000", "kind"=>"provision", "unattended"=>{}} 2018-03-15 11:48:59 32243049 [app] [I] Current user: foreman_api_admin (administrator) 2018-03-15 11:49:01 32243049 [templates] [I] Rendering template 'My custom Kickstart Default' 2018-03-15 11:49:01 32243049 [templates] [I] Rendering template 'My custom Kickstart Default' 2018-03-15 11:49:02 32243049 [app] [I] Rendered inline template (43.7ms) 2018-03-15 11:49:02 32243049 [app] [W] There was an error rendering the My custom Kickstart Default template: | ActionView::Template::Error: Safemode doesn't allow to access 'block_pass' on &:present? | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/parser.rb:135:in `raise_security_error' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/parser.rb:117:in `block (2 levels) in <class:Parser>' | /opt/theforeman/tfm/root/usr/share/gems/gems/sexp_processor-4.4.4/lib/sexp_processor.rb:218:in `block (2 levels) in process' | /opt/theforeman/tfm/root/usr/share/gems/gems/sexp_processor-4.4.4/lib/sexp_processor.rb:275:in `error_handler' | /opt/theforeman/tfm/root/usr/share/gems/gems/sexp_processor-4.4.4/lib/sexp_processor.rb:217:in `block in process' | /opt/theforeman/tfm/root/usr/share/gems/gems/sexp_processor-4.4.4/lib/sexp_processor.rb:340:in `in_context' | /opt/theforeman/tfm/root/usr/share/gems/gems/sexp_processor-4.4.4/lib/sexp_processor.rb:194:in `process' [...] | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/parser.rb:10:in `jail' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:49:in `eval' | /usr/share/foreman/lib/foreman/renderer.rb:56:in `render_safe' | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render' | inline template:1:in `_b114e5b09d39be066d9d09992fa093cc' [...] | /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-3.4.1/lib/secure_headers/middleware.rb:12:in `call' | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/engine.rb:518:in `call' | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/application.rb:165:in `call' | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `public_send' | /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `method_missing' | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in `block in call' | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `each' | /opt/rh/rh-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `call' | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request' | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request' | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop' | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441: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 `block in create_with_logging_context' 2018-03-15 11:49:02 32243049 [app] [I] Rendered text template (0.0ms) 2018-03-15 11:49:02 32243049 [app] [I] Completed 500 Internal Server Error in 2084ms (Views: 0.6ms | ActiveRecord: 11.8ms)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.