conductor-oss/conductor · error · IllegalArgumentException

%s

Error message

%s

What it means

Thrown by ScriptEvaluator.validateScriptSyntax when the GraalVM PolyglotException raised by context.parse(source) is a syntax error. validateScriptSyntax only parses (does not execute) the script to check it is well-formed; a genuine JS syntax error is re-thrown as IllegalArgumentException whose message is the PolyglotException's own message (hence the '%s'). Non-syntax errors (e.g. resource-limit errors) are deliberately ignored.

Source

Thrown at core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java:255

        return input;
    }

    /**
     * Validates that the script is syntactically well formed WITHOUT executing it. Registration
     * time validation must not evaluate expressions: the input bindings still hold unresolved
     * {@code ${...}} placeholders, so any expression referencing a runtime-bound value would throw
     * a ReferenceError and wrongly reject a valid definition (issue #1311).
     *
     * @param script Script whose syntax should be checked.
     * @throws IllegalArgumentException if the script has a syntax error.
     */
    public static void validateScriptSyntax(String script) {
        ensureInitialized();
        try (Context context = createNewContext()) {
            context.parse(getSource(script));
        } catch (PolyglotException e) {
            if (e.isSyntaxError()) {
                throw new IllegalArgumentException(e.getMessage());
            }
            // Anything non-syntactic (e.g. resource limits) is not a validation failure
            LOGGER.debug("Ignoring non-syntax error while validating script: {}", e.getMessage());
        }
    }

    /**
     * Returns a cached compiled {@link Source} for the given script, creating it on first use.
     * Bounded by {@link #sourceCacheMaxSize}; on overflow the cache is cleared (workflow scripts
     * are typically a small, stable set, so the simplest strategy suffices).
     */
    private static Source getSource(String script) {
        Source cached = SOURCE_CACHE.get(script);
        if (cached != null) {
            return cached;
        }
        if (SOURCE_CACHE.size() >= sourceCacheMaxSize) {
            SOURCE_CACHE.clear();

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Read the PolyglotException message in the IllegalArgumentException — it reports the line/column of the syntax error; fix the script there.
  2. Validate the script locally with node --check before registering.
  3. Ensure the script does not rely on runtime values to be syntactically valid (placeholders are fine; structural errors are not).
  4. If the error is actually a resource-limit issue, note that validateScriptSyntax only treats true syntax errors as failures — check engine resource settings for other failures.

Example fix

// before - unterminated string, syntax error
var x = 'hello;
return x;
// after
var x = 'hello';
return x;
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate script syntax before registering
try {
    ScriptEvaluator.validateScriptSyntax(script);
} catch (IllegalArgumentException e) {
    // surface syntax error to the author before persistence
}

Try / catch

try {
    ScriptEvaluator.validateScriptSyntax(script);
} catch (IllegalArgumentException e) {
    // e.getMessage() is the GraalVM syntax error with line/column -> fix the script
}

Prevention

When it happens

Trigger: Registering or validating a JavaScript script (an event-handler condition, an inline task, or any evaluator='javascript' definition) that contains a syntax error — unbalanced braces, invalid token, unterminated string, reserved-word misuse, etc. The script is parsed at registration/validation time before any runtime binding exists.

Common situations: Authoring a JS expression in a workflow/event definition with a typo. Pasting a JS snippet that depends on template placeholders (${...}) that are valid at runtime but the snippet itself is malformed independent of them. A script that uses syntax not supported by the configured GraalVM/JS language version.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/66ccd8c6ac3ce6a7. Report an issue: GitHub.