Project

General

Profile

Actions

Bug #18552

closed

Jinja2 UTF-8 rendering Problem

Added by Alexander Brunhirl about 4 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
System techniques
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
74
Name check:
To do
Fix check:
Checked
Regression:

Description

Hi,

if a jinja2 template contains any non ASCI characters e.g. German umlaute the template rendering stopps.

Best regards,
Alex

node:~ # rudder agent run
Rudder agent 6.1.3.release
Node uuid: ff11c6ec-292d-4740-a513-0d8eb537788b
Start execution with config [20201111-144730-d9896543]

M| State         Technique                 Component                 Key                Message
   warning       fileTemplate              None                      /tmp/failed.jinja  Jinja templating failed with the following error:
E| repaired      fileTemplate              Load Template from a fil| /tmp/failed.jinja  The copy of the file /var/rudder/configuration-repository/shared-files/failed.jinja.tpl from the policy server to /var/rudder/tmp/templates/failed.jinja.tpl was repaired
E| repaired      fileTemplate              Load Template from a fil| /tmp/success.jinja The copy of the file /var/rudder/configuration-repository/shared-files/success.jinja.tpl from the policy server to /var/rudder/tmp/templates/success.jinja.tpl was repaired
E| error         fileTemplate              Expand template           /tmp/failed.jinja  The expansion of the template /var/rudder/tmp/templates/failed.jinja.tpl in /tmp/failed.jinja could not be repaired
E| repaired      fileTemplate              Expand template           /tmp/success.jinja The expansion of the template /var/rudder/tmp/templates/success.jinja.tpl in /tmp/success.jinja was repaired
E| error         fileTemplate              Put permissions           /tmp/failed.jinja  The application of the rights 600 on the file /tmp/failed.jinja, owner=root  group=root could not be repaired
E| repaired      fileTemplate              Put permissions           /tmp/success.jinja The application of the rights 600 on the file /tmp/success.jinja, owner=root  group=root was repaired

## Summary #####################################################################
Not all components were displayed because we are not in full compliance mode. Please run with -g to force full compliance mode.
   => 6 components in Enforce mode
      -> 4 repaired
      -> 2 error
Execution time: 21.12s
################################################################################
Reports sent.
node:~ # head /var/rudder/tmp/templates/*.jinja.tpl
==> /var/rudder/tmp/templates/failed.jinja.tpl <==
# Test comment: äeiöü
{{ vars.sys.fqhost }}

==> /var/rudder/tmp/templates/success.jinja.tpl <==
# Test comment: aeiou
{{ vars.sys.fqhost }}
node:~ # ls -l /tmp/*.jinja
-rw-------. 1 root root 42 Nov 11 14:54 /tmp/success.jinja
node:~ # head /tmp/*.jinja
# Test comment: aeiou
node.example.com
node:~ #

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #18441: Jinja2 templating fails with python 3 with unicode dataReleasedFélix DALLIDETActions
Actions

Also available in: Atom PDF