kestra-io/kestra · error · KestraRuntimeException

Failed to validate configuration for %s '%s'. Error: %s

Error message

Failed to validate configuration for %s '%s'. Error: %s

What it means

Thrown by AbstractPluginInterfaceFactory.resolve() when the Bean Validation (jakarta.validation) validator throws a ConstraintViolationException during plugin validation — distinct from error 38 (deserialization) and the subsequent 'Invalid configuration' path. This fires when the validator itself errors (not when it returns violations), typically because a custom validator on the plugin class threw an exception. The underlying message is embedded. KestraRuntimeException.

Source

Thrown at core/src/main/java/io/kestra/core/plugins/AbstractPluginInterfaceFactory.java:122

        // Plugins are handled as any serializable/deserialize plugins.
        T plugin;
        try {
            // Make sure config is not null, otherwise deserialization result will be null too.
            Map<String, Object> nonEmptyConfig = Optional.ofNullable(pluginConfiguration).orElse(Map.of());
            plugin = (T) JacksonMapper.toMap(nonEmptyConfig, pluginClass);
        } catch (Exception e) {
            throw new KestraRuntimeException(
                String.format("Failed to create %s '%s'. Error: %s", configDisplayName(), pluginId, e.getMessage())
            );
        }

        // Validate configuration.
        Set<ConstraintViolation<T>> violations;
        try {
            violations = validator.validate(plugin);
        } catch (ConstraintViolationException e) {
            throw new KestraRuntimeException(
                String.format("Failed to validate configuration for %s '%s'. Error: %s", configDisplayName(), pluginId, e.getMessage())
            );
        }
        if (!violations.isEmpty()) {
            ConstraintViolationException e = new ConstraintViolationException(violations);
            throw new KestraRuntimeException(
                String.format("Invalid configuration for %s '%s'. Error: '%s'", configDisplayName(), pluginId, e.getMessage()), e
            );
        }

        return plugin;
    }

    /**
     * Builds the exception thrown when no plugin matches the requested id. Overridable so subclasses
     * can enrich the message (e.g. EE surfacing a license-gated type as "installed but not enabled").
     *
     * @param pluginId the requested (unmatched) plugin id.

View on GitHub (pinned to 823fada927)

Solutions

  1. Inspect the embedded error message to locate the failing validator.
  2. If it is a plugin bug, report it to the plugin maintainer with the stack trace.
  3. Temporarily simplify the config to bypass the failing validator and isolate the cause.
  4. Ensure the plugin version matches the Kestra version's validation contract.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    factory.resolve(identifier, config);
} catch (KestraRuntimeException e) {
    if (e.getMessage().startsWith("Failed to validate configuration")) {
        log.error("Plugin validation threw: {}. Likely a custom validator bug.", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: A plugin class has a custom @ConstraintValidator whose isValid() throws; a validator depends on a resource that is unavailable; a validation annotation is misconfigured on the plugin class.

Common situations: Plugin author shipped a buggy custom validator; a validator relies on a context that is null at resolution time; version skew between the plugin and its validation annotations.

Related errors


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