Project

General

Profile

Actions

Bug #24791

closed

Running ansible command fails with Failed rendering template: error during rendering: uninitialized constant Foreman::Renderer::ALLOWED_HELPERS

Added by Peter Ondrejka over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Found with
tfm-rubygem-foreman_ansible-2.2.5-1.fm1_20.el7.noarch
foreman-1.20.0-0.201808201856git5150a1d.0.3.develop.el7.noarch
installed on Centos7

Running the template "Run Command - Ansible Default - Ansible" with ls -la command fails with the following message:

1:Failed to initialize: RuntimeError - Failed rendering template: error during rendering: uninitialized constant Foreman::Renderer::ALLOWED_HELPERS

Rendering a template in the UI also fails, wit the following in prodlog:

```
2018-09-04T10:04:08 [I|app|07b1d] Processing by JobTemplatesController#preview as */*
2018-09-04T10:04:08 [I|app|07b1d] Parameters: {"template"=>"---\n- hosts: all\n tasks:\n - shell: |\n<%= indent(8) { input('command') } %>\n register: out\n - debug: var=out", "preview_host_id"=>"", "id"=>"135-Run Command - Ansible Default"}
2018-09-04T10:04:08 [I|app|07b1d] Current user set to admin (admin)
2018-09-04T10:04:08 [W|app|07b1d] Action failed
ActionView::MissingTemplate: Missing template job_templates/preview, templates/preview, application/preview with {:locale=>[:en], :formats=>[: html, :text, :js, :css, :ics, :csv, :vcf, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, : url_encoded_form, :json, :pdf, :zip, :gzip], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :rabl]}. Searched in: * "/usr/share/foreman/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.10.2/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-12.0.0/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-2.2.5/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.4/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/bastion-6.1.11/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.3/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-4.1.0/app/views" * "/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.9/app/views"

```

Full production log and screenshot attached


Files

prodlog.txt prodlog.txt 14.5 KB Peter Ondrejka, 09/04/2018 08:09 AM
Selection-ansible-.png View Selection-ansible-.png 411 KB Peter Ondrejka, 09/04/2018 08:13 AM
Actions #1

Updated by Peter Ondrejka over 5 years ago

  • Status changed from New to Resolved

With update to tfm-rubygem-foreman_remote_execution-1.6.1-1.fm1_20.el7.noarch I can't reproduce this problem anymore

Actions

Also available in: Atom PDF