{"record":{"id":"b9f086e69f42d87c","repo":"kestra-io/kestra","slug":"geterrormessage-abstract-subclass-defined-erro","errorCode":null,"errorMessage":"getErrorMessage() [abstract: subclass-defined ERROR_MESSAGE]","messagePattern":"getErrorMessage\\(\\) \\[abstract: subclass-defined ERROR_MESSAGE\\]","errorType":"validation","errorClass":"PebbleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/AbstractFileFunction.java","lineNumber":65,"sourceCode":"    protected Provider<NamespaceFactory> namespaceFactory;\n\n    @Inject\n    protected LocalFilesConfiguration localFilesConfiguration;\n\n    //    @Value(\"${kestra.server-type:}\") // default to empty as tests didn't set this property\n    //    private String serverType;\n\n    @SuppressWarnings(\"unchecked\")\n    @Override\n    public Object execute(Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) {\n        // TODO it will be enabled on the next release so the code is kept commented out\n        //  don't forget to also re-enabled the test\n        //        if (!calledOnWorker()) {\n        //            throw new PebbleException(null, \"The 'read' function can only be used in the Worker as it access the internal storage.\", lineNumber, self.getName());\n        //        }\n\n        if (!args.containsKey(PATH)) {\n            throw new PebbleException(null, getErrorMessage(), lineNumber, self.getName());\n        }\n\n        Object path = args.get(PATH);\n\n        try {\n            URI fileUri;\n            String namespace;\n            Map<String, String> flow = (Map<String, String>) context.getVariable(\"flow\");\n            String tenantId = flow.get(TENANT_ID);\n\n            if (path instanceof URI uri) {\n                fileUri = uri;\n                namespace = checkAllowedFileAndReturnNamespace(context, fileUri);\n            } else if (path instanceof String str) {\n                if (str.startsWith(KESTRA_SCHEME)) {\n                    fileUri = URI.create(str);\n                    namespace = checkAllowedFileAndReturnNamespace(context, fileUri);\n                } else if (str.startsWith(LocalPath.FILE_PROTOCOL)) {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/AbstractFileFunction.java#L47-L83","documentation":"AbstractFileFunction is the shared base for the 'read'/'fileExists' Pebble functions (and similar). The abstract getErrorMessage() returns a subclass-specific message used when the required 'path' argument is missing. The throw at execute() happens when args does not contain the 'path' key. The concrete message depends on the subclass (e.g. \"The 'read' function expects an argument 'path'.\").","triggerScenarios":"Calling read() with no argument: {{ read() }}; calling with only a different argument name; calling with a variable that resolves to an absent value so 'path' is never bound.","commonSituations":"Refactoring a template and dropping the path argument; using a positional form that a Pebble version does not bind; typo in the argument name.","solutions":["Provide the path argument: {{ read('kestra:///namespace/flow/executions/.../file') }} or {{ read(outputs.download.uri) }}.","Ensure the variable feeding path is defined and non-null.","Use the documented default (outputs.download.uri) by passing path explicitly rather than relying on omission."],"exampleFix":"// before\n{{ read() }}\n// after\n{{ read(path=outputs.download.uri) }}","handlingStrategy":"validation","validationCode":"// Pebble: always pass path, ideally from a task output\n{{ read(path=(outputs.download.uri ?? 'kestra:///namespace/flow/executions/' ~ execution.id ~ '/tasks/t1/' ~ taskrun.id ~ '/default.ion')) }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the 'path' argument explicitly.","Prefer URIs emitted by task outputs over hand-built strings.","Use the expression editor to confirm path resolves before saving."],"tags":["pebble","function","argument","internal-storage"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}