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
- Inspect ee.getMessage() / the full stack trace in server logs — this is rarely a script bug.
- If OutOfMemoryError: reduce script working set or increase JVM heap.
- Verify the GraalVM/Truffle runtime is correctly on the classpath (check the startup log line `GraalVM polyglot engine: implementation=...`).
- 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
- Monitor JVM heap — OutOfMemoryError surfaces here as a non-polyglot cause.
- Confirm the Truffle/GraalVM runtime is on the classpath (check the startup implementation log line).
- Capture the full ExecutionException cause chain in logs, not just the message.
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
- Error evaluating the script `%s`
- Error evaluating the script `%s` at line %d
- Script not evaluated within %d seconds, interrupted.
- Script execution interrupted: %s
- %s
AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14).
Data as JSON: /api/errors/8fe4b44188634f32.
Report an issue: GitHub.