{"record":{"id":"56e394c788c27fa8","repo":"kestra-io/kestra","slug":"invalid-files-properties-with-type","errorCode":null,"errorMessage":"Invalid `files` properties with type '{}'","messagePattern":"Invalid `files` properties with type '(.+?)'","errorType":"validation","errorClass":"IllegalVariableEvaluationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/models/tasks/runners/PluginUtilsService.java","lineNumber":110,"sourceCode":"        throws IllegalVariableEvaluationException, JsonProcessingException {\n        if (inputFiles instanceof Map) {\n            Map<String, String> castedInputFiles = (Map<String, String>) inputFiles;\n            Map<String, String> nullFilteredInputFiles = new HashMap<>();\n            castedInputFiles.forEach((key, val) ->\n            {\n                if (val != null) {\n                    nullFilteredInputFiles.put(key, val);\n                }\n            });\n            return runContext.renderMap(nullFilteredInputFiles, additionalVars);\n        } else if (inputFiles instanceof String inputFileString) {\n\n            return JacksonMapper.ofJson(false).readValue(\n                runContext.render(inputFileString, additionalVars),\n                MAP_TYPE_REFERENCE\n            );\n        } else {\n            throw new IllegalVariableEvaluationException(\"Invalid `files` properties with type '\" + (inputFiles != null ? inputFiles.getClass() : \"null\") + \"'\");\n        }\n    }\n\n    public static Map<String, Object> parseOut(String line, Logger logger, RunContext runContext, boolean isStdErr, Instant customInstant) {\n        return parseOut(line, logger, runContext, isStdErr, customInstant, false);\n    }\n\n    public static Map<String, Object> parseOut(String line, Logger logger, RunContext runContext, boolean isStdErr, Instant customInstant, boolean debug) {\n\n        TaskLogLineMatcher logLineMatcher = ((DefaultRunContext) runContext).services().taskLogLineMatcher();\n\n        Map<String, Object> outputs = new HashMap<>();\n        try {\n            Optional<TaskLogMatch> matches = logLineMatcher.matches(line, logger, runContext, customInstant);\n            if (matches.isPresent()) {\n                TaskLogMatch taskLogMatch = matches.get();\n                outputs.putAll(taskLogMatch.outputs());\n            } else if (isStdErr) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/models/tasks/runners/PluginUtilsService.java#L92-L128","documentation":"Thrown by PluginUtilsService.transformInputFiles() when the inputFiles argument is neither a Map nor a String — the only two supported shapes. A Map is treated as key/value file entries (rendered per-entry), a String is rendered then parsed as JSON. Any other runtime type (List, Number, Boolean, or null in some code paths) is rejected as an IllegalVariableEvaluationException with the offending class name in the message.","triggerScenarios":"Passing a YAML list of strings where a map is expected; a Pebble expression renders inputFiles to a number or boolean; null is passed through a path that does not short-circuit; malformed JSON string that Jackson fails to parse (caught as Exception, rethrown as this).","commonSituations":"Flow author writes inputFiles as a YAML sequence instead of a mapping; a variable substitution yields a non-string/non-map object; JSON string is malformed.","solutions":["Provide inputFiles as a Map (key=filename, value=content or ROSA) or as a JSON string.","If using a JSON string, ensure it is valid JSON after rendering.","Check Pebble rendering output type — it must resolve to Map or String."],"exampleFix":"# before\ninputFiles:\n  - data.csv\n\n# after\ninputFiles:\n  data.csv: \"{{ outputs.task.uri }}\"","handlingStrategy":"type-guard","validationCode":"if (!(inputFiles instanceof Map) && !(inputFiles instanceof String)) {\n    throw new IllegalVariableEvaluationException(\n        \"inputFiles must be a Map or a JSON String, got: \" + (inputFiles == null ? \"null\" : inputFiles.getClass()));\n}","typeGuard":"function isInputFilesValid(v: unknown): v is Record<string, unknown> | string {\n  return typeof v === 'string' || (typeof v === 'object' && v !== null && !Array.isArray(v));\n}","tryCatchPattern":"try {\n    PluginUtilsService.transformInputFiles(runContext, additionalVars, inputFiles);\n} catch (IllegalVariableEvaluationException e) {\n    log.error(\"inputFiles invalid: {}\", e.getMessage());\n}","preventionTips":["Author inputFiles as a YAML mapping or a JSON string.","Validate the rendered type before passing to transformInputFiles."],"tags":["task-runner","validation","input-files","yaml"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}