Bug 1514902

Summary: host provisioning failed due to an error rendering satellite kickstart default template
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: Provisioning TemplatesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: bkearney, mhulan, sghai
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.15.6.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:08:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nikhil Kathole 2017-11-19 11:14:16 UTC
Description of problem: While provisioning a host using Libvirt Compute resource, there was 500 internal server error: the requested URL returned error.
Failed to kickstart from http://hostname/unattended/provision?token=.....

Version-Release number of selected component (if applicable): Satellite 6.3 snap 25


How reproducible:always


Steps to Reproduce:
1. Use the default provisioning templates
2. Try to provision a host with Libvirt compute resource

Actual results:
The requested URL returned error : 500 Internal Server Error
Error as failed to kickstart from http://hostname/unattended/provision?token=.....

and host gave dracut shell 

Expected results:
Host should provision successfully.

Additional info:

Comment 3 Sachin Ghai 2017-11-20 10:35:42 UTC
I think something wrong w/ Satellite Kickstart Default template:

2017-11-20 05:32:49 5ab6180b [templates] [I] Rendering template 'puppet.conf'
2017-11-20 05:32:49 5ab6180b [app] [I]   Rendered inline template (370.3ms)
2017-11-20 05:32:49 5ab6180b [app] [W] There was an error rendering the Satellite Kickstart Default template: 
 | ActionView::Template::Error: ERF42-7327 [Foreman::Exception]: The snippet 'puppet.conf' threw an error: wrong number of arguments (given 0, expected 1)
 | /usr/share/foreman/lib/foreman/renderer.rb:44:in `host_param_true?'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/scope.rb:37:in `method_missing'
 | puppet.conf:55: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/lib/foreman/renderer.rb:56:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render'
 | /usr/share/foreman/lib/foreman/renderer.rb:121:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/scope.rb:37:in `method_missing'
 | puppet_setup:113: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/lib/foreman/renderer.rb:56:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render'
 | /usr/share/foreman/lib/foreman/renderer.rb:121:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/scope.rb:37:in `method_missing'
 | Satellite Kickstart Default:169: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/lib/foreman/renderer.rb:56:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render'
 | inline template:1:in `_4f6d648bcdf37613afdd5685229c38da'

Comment 4 Marek Hulan 2017-11-20 15:15:09 UTC
Regression caused by BZ 1511158
the puppet.conf line defining aio_enabled got split into two lines, it needs to be single line.

Comment 7 Nikhil Kathole 2017-11-28 09:39:13 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 26

2017-11-28 04:24:08 46e91fab [app] [I] Started GET "/unattended/provision?token=958db3e6-bd20-4384-933a-3fb40cf92281" for <IP>
at 2017-11-28 04:24:08 -0500
2017-11-28 04:24:08 46e91fab [app] [I] Processing by UnattendedController#host_template as TEXT
2017-11-28 04:24:08 46e91fab [app] [I]   Parameters: {"token"=>"958db3e6-bd20-4384-933a-3fb40cf92281", "kind"=>"provision"}
2017-11-28 04:24:08 46e91fab [app] [I] Current user: foreman_api_admin (administrator)
2017-11-28 04:24:12 46e91fab [templates] [I] Rendering template 'Kickstart default'
2017-11-28 04:24:12 46e91fab [templates] [I] Rendering template 'Satellite Kickstart Default'
2017-11-28 04:24:12 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:13 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:13 46e91fab [templates] [I] Rendering template 'Kickstart default'
2017-11-28 04:24:13 46e91fab [templates] [I] Rendering template 'kickstart_networking_setup'
2017-11-28 04:24:13 46e91fab [templates] [I] Rendering template 'kickstart_ifcfg_get_identifier_names'
2017-11-28 04:24:13 46e91fab [templates] [I] Rendering template 'kickstart_ifcfg_generic_interface'
2017-11-28 04:24:13 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:13 46e91fab [templates] [I] Rendering template 'subscription_manager_registration'
2017-11-28 04:24:13 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:13 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:13 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.info in a template, it will be removed in 1.17
. Use host_enc instead.
2017-11-28 04:24:14 46e91fab [templates] [I] Rendering template 'remote_execution_ssh_keys'
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [templates] [I] Rendering template 'puppet_setup'
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed
in 1.17. Use host_param_true? instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed
in 1.17. Use host_param_true? instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [templates] [I] Rendering template 'puppet.conf'
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed
in 1.17. Use host_param_true? instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed
in 1.17. Use host_param_true? instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed
in 1.17. Use host_param_true? instead.
2017-11-28 04:24:14 46e91fab [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.
17. Use host_param instead.
2017-11-28 04:24:14 46e91fab [templates] [I] Rendering template 'ansible_provisioning_callback'
2017-11-28 04:24:14 46e91fab [app] [I]   Rendered inline template (1824.2ms)
2017-11-28 04:24:14 46e91fab [app] [I] Completed 200 OK in 6144ms (Views: 1758.8ms | ActiveRecord: 118.0ms)

Comment 8 Bryan Kearney 2018-02-21 17:08:53 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336