Project

General

Profile

Actions

Bug #3210

closed

Wrong stringTemplate definition on a Technique result in a confusing error in the Rudder UI

Added by Matthieu CERDA almost 12 years ago. Updated over 9 years ago.

Status:
Released
Priority:
2
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Trying to use a bad stringTemplate definition on a Technique outputs a confusing error in the Rudder UI

While trying to develop a new Technique, I made a trivial mistake like this in my .st file:

&FOO, BAR:{foo, bar | "&notfoo&" string => "&bar&"; }&

As you can see, &notfoo& here should be &foo& to make the mapping between the big FOO variable and the transformation in a CFEngine string variable.

However, instead of outputting an error like "The Technique XXX is broken (stringtemplate error)" and eventually ignoring the Technique and going on the deployment, Rudder outputs something like:

Exception caught during deployment process: no such attribute: notfoo in template context [anonymous anonymous]

The stacktrace in the webapp logs is roughly the same:

Exception caught during deployment process:
java.util.NoSuchElementException: no such attribute: notfoo in template context [anonymous anonymous] at org.antlr.stringtemplate.StringTemplate.checkNullAttributeAgainstFormalArguments(StringTemplate.java:1311) ~[stringtemplate-3.2.1.jar:na]

This has been discovered in a 2.4.2 Rudder, but I suspect that it impacts 2.3 too.

Actions

Also available in: Atom PDF