Bug 1174381 - There was an error rendering the Kickstart default template
Summary: There was an error rendering the Kickstart default template
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: ruby193-rubygem-staypuft
Version: Foreman (RHEL 6)
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: z4
: Installer
Assignee: Mike Burns
QA Contact: Alexander Chuzhoy
URL:
Whiteboard:
Depends On:
Blocks: 1242807 1242808 1242810 1242811
TreeView+ depends on / blocked
 
Reported: 2014-12-15 18:56 UTC by Tyson Hammen
Modified: 2019-07-11 08:28 UTC (History)
18 users (show)

Fixed In Version: rubygem-staypuft-0.5.25-2.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1242807 1242808 1242810 1242811 (view as bug list)
Environment:
Last Closed: 2015-08-24 15:17:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2120381 0 None None None 2016-01-12 08:51:59 UTC
Red Hat Product Errata RHBA-2015:1662 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Installer update 2015-08-24 19:16:51 UTC

Description Tyson Hammen 2014-12-15 18:56:46 UTC
Description of problem: Fresh provision of CentOS6.6 host with latest nightly of foreman and staypuft fails to provision nodes with the following error. 
"There was an error rendering the Kickstart default template: The snippet 'kickstart_networking_setup' threw an error: private method `layout' called for nil:NilClass"

Version-Release number of selected component (if applicable): foreman 1.8 dev, staypuft installer 0.5.3


How reproducible: Install latest staypuft installer and foreman on fresh CentOS 6.6 machine and attempt to provision a Centos 7 host.


Steps to Reproduce:
1.Install CentOS 6.6
2.Install Staypuft installer and foreman from nightlies
3.correct installation media issue with CentOS 7
4.attempt to provision a new host

Actual results:Node fails to provision with error: There was an error rendering the Kickstart default template: The snippet 'kickstart_networking_setup' threw an error: private method `layout' called for nil:NilClass


Expected results:Node provisions successfully 


Additional info:

Comment 3 Tyson Hammen 2014-12-16 04:59:22 UTC
after some discussions in the staypuft irc channel I updated to the latest version of the ruby gem (0.5.5). This did not resolve the issue.

Comment 4 Tyson Hammen 2014-12-16 06:05:20 UTC
Here are the exact steps I used on a fresh install of CentOS 6.6

set hostname in /etc/hosts and ensure hostname and hostname -f report the correct hostname

yum -y update

setup the environment
yum -y install http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install http://yum.theforeman.org/nightly/el6/x86_64/foreman-release.rpm
yum -y install centos-release-SCL
yum -y install foreman-installer-staypuft

staypuft-installer

Comment 5 Rajani 2014-12-22 16:39:35 UTC
I too face the same problem with provision template. I am using Kickstart RHEL default as provision template and it shows "There was an error rendering the Kickstart RHEL default template: private method `layout' called for nil:NilClass".
Build on Host fails with error: "failed to fetch kickstart".
Any workaround for this problem?

Comment 6 Ryan Hughes 2015-01-12 03:58:31 UTC
I ran into this same issue on a nested ESXi test run and I only supplied one NIC to each of the VM's. Once I added a second NIC, the kickstart worked and I was able to install.

From discussing with the team on the IRC #staypuft channel on irc.freenode.net; it was pointed out that the installer script expects a minimum of 2 NIC's required for proper deployment.

Comment 7 Rajani 2015-01-12 12:56:03 UTC
My setup had 2 interfaces on installer and 3 on controller node. Still I faced this issue.
After some debugging, I identified that the problem lies with the provision template. The provision template 'Kicckstart RHEL default' makes use of snippets 'kickstart_networking_setup' which was not existing in /usr/share/foreman/app/views/unattended/snippets. After removing this snippet from template, provisioning worked fine and we have manually setup the networking on hosts. 
However, the hosts thus provisioned are not visible for deployment. The status of the hosts are shown "OK" and reports are recieved at proper intervals.

Comment 8 Ramon Acedo 2015-01-25 20:14:35 UTC
I am getting the error in Foreman 1.6 in RHEL 6.6 with the rhel-osp-installer:

foreman-1.6.0.44-6.el6ost.noarch
rhel-osp-installer-0.4.7-1.el6ost.noarch

The error when trying to render the provisioning template is the following:

"There was an error rendering the Kickstart RHEL default template: private method `layout' called for nil:NilClass"

I haven't found where it fails in the template/snippet but when enabling debugging in foreman I can see this:

rendering snippet kickstart_networking_setup
  Nic::Base Load (0.4ms)  SELECT "nics".* FROM "nics" WHERE "nics"."host_id" = 11 AND "nics"."type" = 'Nic::Bond' AND "nics"."managed" = 't' ORDER BY identifier
  Nic::Base Load (0.3ms)  SELECT "nics".* FROM "nics" WHERE "nics"."host_id" = 11 AND "nics"."managed" = 't' AND "nics"."identifier" IN ('eno33557248', 'eno50336512') ORDER BY identifier
  Nic::Base Load (0.2ms)  SELECT "nics".* FROM "nics" WHERE "nics"."host_id" = 11 AND "nics"."type" = 'Nic::Managed' AND "nics"."managed" = 't' ORDER BY identifier
  Subnet Load (0.2ms)  SELECT "subnets".* FROM "subnets" WHERE "subnets"."id" = 6 ORDER BY vlanid LIMIT 1
  Staypuft::Deployment Load (0.2ms)  SELECT "staypuft_deployments".* FROM "staypuft_deployments" INNER JOIN "staypuft_deployment_role_hostgroups" ON "staypuft_deployments"."id" = "staypuft_deployment_role_hostgroups"."deployment_id" WHERE "staypuft_deployment_role_hostgroups"."hostgroup_id" = 1 LIMIT 1
  Rendered inline template (211.5ms)
  Rendered text template (0.0ms)
Completed 500 Internal Server Error in 233ms (Views: 0.4ms | ActiveRecord: 5.4ms)


There is a query on the staypuft_deployments table which does't return anything, probably because this node is not part of a staypuft deployment.

This is a node discovered being provisioned with the default templates for RHEL 7 and hostgroup base_RedHat_7 directly out of the OSP deployment in Foreman.

Comment 9 Dave Cain 2015-02-04 21:56:12 UTC
Are there any updates on this issue?  I am seeing similar behavior as Ramon indicated on 1/25.

Comment 10 Brendan Howes 2015-05-28 20:05:13 UTC
We hit this today  - RHEL7.1+OSP6+Foreman 1.6rc1 - nodes booting have a nil:Nilclass error on kickstart_networking_setup

Comment 11 john casey 2015-06-03 08:09:45 UTC
We've been hitting this all week.  Are there any fixes for this problem  RHEL 7.1_OSP6_Forman1.6rc1

Comment 12 Jaison Raju 2015-06-11 05:39:35 UTC
Hello Everyone,

Can everyone confirm how many nics are present on the host &
how many are assigned to any network ?
Confirm if bond interface is used configured via staypuft for host.
Confirm if anyone is using custom provision template , where template name has a dot ? 
If you are using built in template using osp installer , can you confirm the template name ?
We are working on a workaround . Will update in few days .

Regards,
Jaison R

Comment 15 john casey 2015-06-11 06:34:10 UTC
Originally our environment looked like this

Setup 1 - Not successful. 
foreman Node - 2nics (1 access nw no vlan) (2 provisioning nw vlan)
Controller Node - 2nic (1 external nw) (2 provisioning nw vlan)
compute Node - 2nics (1 access nw) (2 provisioning nw vlan)

Setup had 2 subnets (external, tenant) vxlan / ovs

We tried unsuccessfully to use nic1 as both external network and tenant network.  We tried to use foreman to create a vlan on nic1 to separate tenant /external.  The vlan configuration option does not appear to work.

Since we have a dhcp server on our access mgmt network, we had to make the provisioning network on it's own vlan.   

Then we changed our configuration to this:

Setup 2 - successful.
foreman Node - 2nics (1 access)  (2 provisioning nw vlan)
Controller Node - 3nic (1 external) (2 provisioning nw vlan) (3 tenant nw )
compute Node - 3nics (1 external) (2 provisioning nw vlan) (3 tenant nw)

We had to turn off the foreman's DHCP on the subnet and use all static addresses.  DHCP other than on the provisioning network does not seem to work.

---------

In general we found foreman almost impossible to debug.  other than journalctrl and /var/log/foreman-installer with few terse messages there was not real debugging information.   We are new to foreman so if we are missing something please point us to the right direction.

Comment 16 Nidhin 2015-07-06 11:50:05 UTC
Do we have a fix for this issue now ?

RHEL 7.1 
OSP 6
FOREMAN 1.6.0.49-6

2 NICs on controller and compute nodes each.
No bonded interface configured.
Using built in template  , "Kickstart RHEL default".

Regards,
Nidhin

Comment 17 Mike Burns 2015-07-06 12:34:26 UTC
For OSP 6, This is very similar to another issue which is fixed with this patch:

https://github.com/theforeman/staypuft/commit/e2e348a0eb38b66d1880699e94bd26376bb122f7

Other issues related to OSP5 or centos are unclear, but please refile if they're still relevant.

Comment 19 Alexander Chuzhoy 2015-08-17 18:55:11 UTC
Verified:

Environment:
ruby193-rubygem-staypuft-0.5.26-1.el7ost.noarch


Node provisions successfully.
Note: I also set the MTU to a custom value 1471.

Comment 21 errata-xmlrpc 2015-08-24 15:17: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://rhn.redhat.com/errata/RHBA-2015-1662.html


Note You need to log in before you can comment on or make changes to this bug.