{"record":{"id":"001727d42d213227","repo":"kestra-io/kestra","slug":"failed-to-create-s-s-error-s","errorCode":null,"errorMessage":"Failed to create %s '%s'. Error: %s","messagePattern":"Failed to create (.+?) '(.+?)'\\. Error: (.+?)","errorType":"exception","errorClass":"KestraRuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/plugins/AbstractPluginInterfaceFactory.java","lineNumber":112,"sourceCode":"        Class<? extends Plugin> pluginClass = pluginRegistry\n            .findClassByIdentifier(pluginVersion == null ? pluginType : pluginType + \":\" + pluginVersion);\n        if (pluginClass == null) {\n            List<String> supportedVersions = pluginRegistry.getAllVersionsForType(pluginType);\n            throw new KestraRuntimeException(\n                \"No %s can be found for '%s=%s', and version=%s. Supported versions are: %s\".formatted(\n                    lookupDisplayName(), typeProperty(), pluginId, pluginVersion, supportedVersions\n                )\n            );\n        }\n\n        // Plugins are handled as any serializable/deserialize plugins.\n        T plugin;\n        try {\n            // Make sure config is not null, otherwise deserialization result will be null too.\n            Map<String, Object> nonEmptyConfig = Optional.ofNullable(pluginConfiguration).orElse(Map.of());\n            plugin = (T) JacksonMapper.toMap(nonEmptyConfig, pluginClass);\n        } catch (Exception e) {\n            throw new KestraRuntimeException(\n                String.format(\"Failed to create %s '%s'. Error: %s\", configDisplayName(), pluginId, e.getMessage())\n            );\n        }\n\n        // Validate configuration.\n        Set<ConstraintViolation<T>> violations;\n        try {\n            violations = validator.validate(plugin);\n        } catch (ConstraintViolationException e) {\n            throw new KestraRuntimeException(\n                String.format(\"Failed to validate configuration for %s '%s'. Error: %s\", configDisplayName(), pluginId, e.getMessage())\n            );\n        }\n        if (!violations.isEmpty()) {\n            ConstraintViolationException e = new ConstraintViolationException(violations);\n            throw new KestraRuntimeException(\n                String.format(\"Invalid configuration for %s '%s'. Error: '%s'\", configDisplayName(), pluginId, e.getMessage()), e\n            );","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/plugins/AbstractPluginInterfaceFactory.java#L94-L130","documentation":"Thrown by AbstractPluginInterfaceFactory.resolve() when JacksonMapper.toMap() fails to deserialize the plugin configuration map into the plugin class — i.e., the configuration values do not map onto the plugin's fields (wrong types, unknown nested structure, JSON coercion failure). The original exception message is embedded. This is a KestraRuntimeException indicating the config block is structurally invalid for the target plugin type.","triggerScenarios":"A config property expects an integer but receives a string that cannot be coerced; a nested object does not match the plugin's nested type; a required constructor argument is missing; a field type changed between plugin versions and the config is stale.","commonSituations":"Stale flow YAML after a plugin upgrade changed field types; typo in a nested config key; copy-paste of config from a different plugin.","solutions":["Read the embedded error message to find the failing field and type.","Align the config value types with the plugin's current API for the installed version.","Consult the plugin's documentation for the correct field types and names.","Update the plugin version or revert the config to a known-good shape."],"exampleFix":"# before\n- id: upload\n  type: io.kestra.plugin.aws.s3.Upload\n  retry: \"abc\"   # expects int\n# Failed to create ... Error: cannot deserialize\n\n# after\n- id: upload\n  type: io.kestra.plugin.aws.s3.Upload\n  retry: 3","handlingStrategy":"try-catch","validationCode":"// Pre-validate config value types against the plugin class fields before resolution\nMap<String,Object> cfg = Optional.ofNullable(pluginConfiguration).orElse(Map.of());\ntry {\n    JacksonMapper.toMap(cfg, pluginClass);\n} catch (Exception e) {\n    log.warn(\"Config will fail to deserialize: {}\", e.getMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n    factory.resolve(identifier, config);\n} catch (KestraRuntimeException e) {\n    if (e.getMessage().startsWith(\"Failed to create\")) {\n        log.error(\"Plugin config deserialization error: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Keep flow YAML in sync with the installed plugin version's field types.","Validate config blocks against plugin docs after upgrades."],"tags":["plugin","configuration","deserialization","validation"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}