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 #1

Updated by Matthieu CERDA almost 12 years ago

  • Target version changed from 2.4.3 to 2.4.4
Actions #2

Updated by François ARMAND over 11 years ago

  • Status changed from New to Discussion
  • Assignee changed from François ARMAND to Nicolas CHARLES

Nicolas, is there some context in which it could something else than a typo in the Technique? Something like a variable that should have been bound, but is not ?
Or do you think we can say in the error message that it's an error in the Technique ?
In all case, I thing we could at least give the path to the Technique that leaded to the error.

Actions #3

Updated by François ARMAND over 11 years ago

  • Status changed from Discussion to 8
  • Assignee changed from Nicolas CHARLES to François ARMAND

It seems to always be an error, so have to be handle and cleary reported in logs.

Actions #4

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.4 to 2.4.5
Actions #5

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.5 to 2.4.6
Actions #6

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.6 to 2.4.7
Actions #7

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.7 to 2.4.8
Actions #8

Updated by Nicolas PERRON about 11 years ago

  • Target version changed from 2.4.8 to 2.4.9
Actions #9

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from 8 to Pending technical review
  • Pull Request set to https://github.com/Normation/cf-clerk/pull/24
Actions #10

Updated by Nicolas PERRON about 11 years ago

  • Target version changed from 2.4.9 to 2.4.10
Actions #11

Updated by François ARMAND about 11 years ago

  • Status changed from Pending technical review to Discussion
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
Actions #12

Updated by François ARMAND about 11 years ago

Comments on the PR.

Actions #13

Updated by Vincent MEMBRÉ about 11 years ago

  • Assignee changed from Vincent MEMBRÉ to François ARMAND

I updated the PR and answered to your comments

Actions #14

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from Discussion to Pending technical review
Actions #15

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

Applied in changeset clerk:commit:c9f9002d1ed320d863fee92aa8a76d7a799b1f42.

Actions #16

Updated by Anonymous about 11 years ago

Applied in changeset clerk:commit:4c55b9fefeb54a719dced310a0329dad733a3778.

Actions #17

Updated by Vincent MEMBRÉ about 11 years ago

  • Target version changed from 2.4.10 to 2.4.9
Actions #18

Updated by Nicolas PERRON about 11 years ago

  • Subject changed from Trying to use a bad stringTemplate definition on a Technique outputs a confusing error in the Rudder UI to Wrong stringTemplate definition on a Technique result in a confusing error in the Rudder UI
Actions #19

Updated by Nicolas PERRON about 11 years ago

This bug has been fixed in Rudder 2.4.9, which was released today.
Check out:

Actions #20

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending release to Released
Actions #21

Updated by Benoît PECCATTE over 9 years ago

  • Category changed from 14 to Web - Config management
Actions

Also available in: Atom PDF