Bug 1482060

Summary: Error during rendering Satellite Kickstart Default template: ActionView::Template::Error: Safemode doesn't allow to access 'block_pass' on &:present?
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Provisioning TemplatesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: medium    
Version: UnspecifiedCC: akarimi, bbuckingham, bkearney, ehelms, gapatil, mhulan, sghai
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:00:10 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 Roman Plevka 2017-08-16 11:49:27 UTC
Description of problem:
There is an error preventing Satellite to render a provisioningtemplate on

GET "/unattended/provision?token=..."

request.

2017-08-16 13:08:57 89c60027 [app] [W] There was an error rendering the Satellite 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>'
...

This prevents kickstart provisioning to finish.

Version-Release number of selected component (if applicable):
# rpm -qa satellite
satellite-6.3.0-16.0.beta.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. use the default provisioning templates
2. sync a rhel kickstart repo (i used 7.4)
3. try to provision a host (i used libvirt CR, but baremetal should hit this too)

Actual results:
There was an error rendering the Satellite Kickstart Default template: 
 | ActionView::Template::Error: Safemode doesn't allow to access 'block_pass' on &:present?

installation never finishes, falling back to dracut shell

Expected results:
no error, provisioning finishes smoothly

Comment 5 Marek Hulan 2017-08-17 19:32:43 UTC
Fix was cherry-picked to 1.15-stable branch so it will deivered in 1.15.4 but we also need to fix katello templace and theme plugi template.

Comment 7 Roman Plevka 2017-09-27 20:13:04 UTC
VERIFIED

sat6.3.0-17

The templates render correctly, host provisioning works again, no errors in the logs.

Comment 8 Bryan Kearney 2018-02-21 17:00:10 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