Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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