kestra-io/kestra · error · PebbleException
The argument 'value' is required.
Error message
The argument 'value' is required.
What it means
Thrown by the EndsWithFilter when the required 'value' argument is null or missing. The endsWith filter checks whether the input string ends with the given suffix; without the suffix, the check is meaningless.
Source
Thrown at core/src/main/java/io/kestra/core/runners/pebble/filters/EndsWithFilter.java:32
public static final String FILTER_NAME = "endsWith";
private static final String ARGUMENT_VALUE = "value";
private final static List<String> ARGS = List.of(ARGUMENT_VALUE);
@Override
public List<String> getArgumentNames() {
return ARGS;
}
@Override
public Object apply(Object input, Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) throws PebbleException {
if (input == null) {
return false;
}
if (args.get(ARGUMENT_VALUE) == null) {
throw new PebbleException(
null,
MessageFormat.format("The argument ''{0}'' is required.", ARGUMENT_VALUE),
lineNumber,
self.getName()
);
}
String data = input.toString();
return data.endsWith(args.get(ARGUMENT_VALUE).toString());
}
}
View on GitHub (pinned to 823fada927)
Solutions
- Provide a non-null string value argument: '{{ mystring | endsWith(".txt") }}'.
- Guard optional variables with a default: '{{ mystring | endsWith(vars.suffix ?? "") }}'.
- Verify the variable name spelling and that it is defined in the flow.
Example fix
{# before #}
{{ filename | endsWith(vars.ext) }}
{# vars.ext is undefined #}
{# after #}
{{ filename | endsWith(vars.ext ?? ".txt") }} Defensive patterns
Strategy: validation
Validate before calling
{# Always provide a non-null value argument to endsWith #}
{% set suffix = vars.suffix ?? ".txt" %}
{{ filename | endsWith(suffix) }} Prevention
- Always pass the value argument explicitly to endsWith.
- Default optional suffix variables with ?? to a non-null fallback.
- Verify variable names are spelled correctly and defined in the flow.
When it happens
Trigger: Calling endsWith without the value argument, or with a value that resolves to null: '{{ mystring | endsWith }}', '{{ mystring | endsWith(vars.missing) }}' where vars.missing is undefined.
Common situations: A suffix value sourced from an optional variable that may be absent. Forgetting to pass the argument in a copy-pasted template. A variable name typo causing the argument to resolve to null.
Related errors
- The '%s' filter expects an integer as argument 'amount'.
- 'chunk' filter expects an argument 'size'.
- The 'escapeChar' filter expects an argument 'type'.
- The 'encrypt' function expects two arguments 'key' and 'plai
- The 'env' function expects an argument 'name'.
AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14).
Data as JSON: /api/errors/390dd7de8e20fff0.
Report an issue: GitHub.