kestra-io/kestra · error · PebbleException

The argument ''{0}'' is required.

Error message

The argument ''{0}'' is required.

What it means

Thrown by the 'startsWith' Pebble filter when the required `value` argument is null or missing. The filter delegates to `String.startsWith(value)` and needs a non-null prefix to compare against.

Source

Thrown at core/src/main/java/io/kestra/core/runners/pebble/filters/StartsWithFilter.java:32

    public static final String FILTER_NAME = "startsWith";

    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.startsWith(args.get(ARGUMENT_VALUE).toString());
    }
}

View on GitHub (pinned to 823fada927)

Solutions

  1. Supply the named argument: `{{ s | startsWith(value="https://") }}`.
  2. Default dynamic prefixes: `value=inputs.prefix ?? ""`.
  3. Remember the argument is named `value` (not `prefix`).

Example fix

# before
{{ url | startsWith }}
# after
{{ url | startsWith(value="https://") }}
Defensive patterns

Strategy: validation

Validate before calling

# Always pass the value argument:
{{ s | startsWith(value=inputs.prefix ?? "") }}

Type guard

{% if inputs.prefix is not null %}
  {{ s | startsWith(value=inputs.prefix) }}
{% endif %}

Prevention

When it happens

Trigger: Writing `{{ s | startsWith }}` without arguments; passing a variable for `value` that resolved to null; misspelling the argument (e.g. `prefix=` or `with=` instead of `value=`).

Common situations: Refactoring drops the argument; referencing an unset input as the prefix; assuming a default empty prefix.

Related errors


AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14). Data as JSON: /api/errors/300e95c66ab7185c. Report an issue: GitHub.