Red Hat Bugzilla – Bug 1315754
'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String) while provisioning a host with extra interfaces
Last modified: 2018-08-31 11:19 EDT
Description of problem: I was configuring alias and vlan interfaces while provisioning a host and provisioning failed with below error: 2016-03-08 08:44:01 [app] [I] Started GET "/unattended/provision?token=bb9a07e8-5425-44d3-b45c-013f9d89d3d5" for 192.168.100.22 at 2016-03-08 08:44:01 -0500 2016-03-08 08:44:01 [app] [I] Processing by UnattendedController#host_template as */* 2016-03-08 08:44:01 [app] [I] Parameters: {"token"=>"bb9a07e8-5425-44d3-b45c-013f9d89d3d5", "kind"=>"provision"} 2016-03-08 08:44:01 [app] [I] Found mac525400490367.idmqe.lab.eng.bos.redhat.com 2016-03-08 08:44:03 [app] [I] Rendered inline template (126.6ms) 2016-03-08 08:44:03 [app]2016-03-08 08:44:01 [app] [I] Started GET "/unattended/provision?token=bb9a07e8-5425-44d3-b45c-013f9d89d3d5" for 192.168.100.22 at 2016-03-08 08:44:01 -0500 2016-03-08 08:44:01 [app] [I] Processing by UnattendedController#host_template as */* 2016-03-08 08:44:01 [app] [I] Parameters: {"token"=>"bb9a07e8-5425-44d3-b45c-013f9d89d3d5", "kind"=>"provision"} 2016-03-08 08:44:01 [app] [I] Found mac525400490367.idmqe.lab.eng.bos.redhat.com 2016-03-08 08:44:03 [app] [I] Rendered inline template (126.6ms) 2016-03-08 08:44:03 [app] [W] There was an error rendering the Katello Kickstart Default template: | ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String) | /usr/share/foreman/lib/foreman/renderer.rb:75:in `rescue in snippet' | /usr/share/foreman/lib/foreman/renderer.rb:72:in `snippet' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/scope.rb:37:in `method_missing' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:141:in `bind' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval' [W] There was an error rendering the Katello Kickstart Default template: | ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String) | /usr/share/foreman/lib/foreman/renderer.rb:75:in `rescue in snippet' | /usr/share/foreman/lib/foreman/renderer.rb:72:in `snippet' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/scope.rb:37:in `method_missing' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:141:in `bind' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval' Version-Release number of selected component (if applicable): Sat 6.2 snap2 How reproducible: always Steps to Reproduce: 1. provision a host with alias interface so that it uses 'kickstart_networking_setup' scriptlet 2. 3. Actual results: | ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String) Expected results: Additional info:
Fixed in gem safemode 1.2.3, to workaround you can either install the gem from here http://koji.katello.org/packages/tfm-rubygem-safemode/1.2.3/ or disable safemode rendering (Settings -> Provisioning). Don't forget to restart httpd afterwards (in both cases)
Upstream packaging update -- https://github.com/theforeman/foreman-packaging/commit/a6a767673ce336530dbdb0fe23bc2bba669cb70e
Verified with sat6.2 snap4. The reported issue has been fixed with following : ~]# rpm -qa | grep safemode tfm-rubygem-safemode-1.2.3-1.el7sat.noarch I can provision the host with configuration of virtual interfaces and didn't see the reported exception related to snippet 'kickstart_networking_setup'
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/RHBA-2016:1500