conductor-oss/conductor · error · TerminateWorkflowException

Error evaluating the script %s

Error message

Error evaluating the script %s

What it means

The fallback branch of handlePolyglotException: the ExecutionException's cause is NOT a PolyglotException (some other Throwable escaped the guest eval). The raw ee.getMessage() is wrapped in a TerminateWorkflowException. This is the catch-all for unexpected, non-polyglot failures during script evaluation.

Source

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

            }
        }
    }

    private static void handlePolyglotException(ExecutionException ee) {
        if (ee.getCause() instanceof PolyglotException pe) {
            SourceSection sourceSection = pe.getSourceLocation();
            if (sourceSection == null) {
                throw new TerminateWorkflowException(
                        "Error evaluating the script `" + pe.getMessage() + "`");
            } else {
                throw new TerminateWorkflowException(
                        "Error evaluating the script `"
                                + pe.getMessage()
                                + "` at line "
                                + sourceSection.getStartLine());
            }
        }
        throw new TerminateWorkflowException("Error evaluating the script " + ee.getMessage());
    }

    private static Object getObject(Value value) {
        if (value.isNull()) return null;
        if (value.isBoolean()) return value.asBoolean();
        if (value.isString()) return value.asString();
        if (value.isNumber()) {
            if (value.fitsInInt()) return value.asInt();
            if (value.fitsInLong()) return value.asLong();
            if (value.fitsInDouble()) return value.asDouble();
        }
        if (value.hasArrayElements()) {
            List<Object> items = new ArrayList<>();
            for (int i = 0; i < value.getArraySize(); i++) {
                items.add(getObject(value.getArrayElement(i)));
            }
            return items;
        }

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Inspect ee.getMessage() / the full stack trace in server logs — this is rarely a script bug.
  2. If OutOfMemoryError: reduce script working set or increase JVM heap.
  3. Verify the GraalVM/Truffle runtime is correctly on the classpath (check the startup log line `GraalVM polyglot engine: implementation=...`).
  4. File an issue if the cause is an engine-level bug; capture the full ExecutionException cause chain.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Object result = ScriptEvaluator.eval(script, input);
} catch (TerminateWorkflowException e) {
    // non-polyglot cause; capture full server stack trace for diagnosis
    LOGGER.error("Unexpected script eval failure: {}", e.getMessage());
    throw e;
}

Prevention

When it happens

Trigger: A non-polyglot Throwable propagates from Context.eval: OutOfMemoryError, an IllegalStateException from a closed/misconfigured Context, a GraalVM engine failure, or a host-side runtime error not represented as PolyglotException.

Common situations: JVM heap exhaustion while evaluating a large script; GraalVM engine misconfiguration; classpath issues with the Truffle runtime producing a non-polyglot error.

Related errors


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