{"record":{"id":"aa8c5ce15d5cec43","repo":"kestra-io/kestra","slug":"cannot-process-the-uri-s-scheme-not-supported","errorCode":null,"errorMessage":"Cannot process the URI %s: scheme not supported.","messagePattern":"Cannot process the URI (.+?): scheme not supported\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/AbstractFileFunction.java","lineNumber":91,"sourceCode":"            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)) {\n                    fileUri = URI.create(str);\n                    namespace = checkEnabledLocalFileAndReturnNamespace(args, flow);\n                } else if (str.startsWith(Namespace.NAMESPACE_FILE_SCHEME)) {\n                    fileUri = URI.create(str);\n                    namespace = checkedAllowedNamespaceAndReturnNamespace(args, fileUri, tenantId, flow);\n                } else if (URI_PATTERN.matcher(str).matches()) {\n                    // it is an unsupported URI\n                    throw new IllegalArgumentException(SCHEME_NOT_SUPPORTED_ERROR.formatted(str));\n                } else {\n                    fileUri = URI.create(Namespace.NAMESPACE_FILE_SCHEME + \":///\" + str);\n                    namespace = (String) Optional.ofNullable(args.get(NAMESPACE)).orElse(flow.get(NAMESPACE));\n                    namespaceService.get().checkAllowedNamespace(tenantId, namespace, tenantId, flow.get(NAMESPACE));\n                }\n            } else {\n                throw new PebbleException(null, \"Unable to read the file \" + path, lineNumber, self.getName());\n            }\n            return fileFunction(context, fileUri, namespace, tenantId, args);\n        } catch (IOException | IllegalArgumentException e) { // IllegalArgumentException may be thrown for path traversal, catch it to have proper error handling\n            throw new PebbleException(e, e.getMessage(), lineNumber, self.getName());\n        }\n    }\n\n    @Override\n    public List<String> getArgumentNames() {\n        return List.of(PATH, NAMESPACE);\n    }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/AbstractFileFunction.java#L73-L109","documentation":"Inside AbstractFileFunction.execute(), after checking the supported schemes (kestra:///, file://, namespace://), if the string still matches the generic URI pattern (scheme:something) an IllegalArgumentException is thrown with 'Cannot process the URI %s: scheme not supported.' The surrounding catch wraps it into a PebbleException carrying e.getMessage().","triggerScenarios":"Passing an http/https/ftp/s3/custom-scheme URI to read(): {{ read('https://example.com/data.json') }}. Any scheme other than kestra, file, or namespace triggers it.","commonSituations":"Trying to read a remote URL directly with read() (which is internal-storage only); pasting a public URL expecting an HTTP fetch; plugin confusion about which function fetches remote content.","solutions":["Use an HTTP task (e.g. io.kestra.plugin.core.http.Request) to fetch remote URLs, then read the downloaded internal-storage URI.","Convert remote content into a kestra:/// internal storage URI before passing to read().","For namespace files use the namespace:// scheme; for local worker files use file:// (if enabled)."],"exampleFix":"// before\n{{ read('https://example.com/data.json') }}\n// after\nid: fetch\nnamespace: company.team\ntasks:\n  - id: http\n    type: io.kestra.plugin.core.http.Request\n    uri: https://example.com/data.json\n  - id: use\n    type: io.kestra.plugin.core.log.Log\n    message: \"{{ read(outputs.http.body) }}\"","handlingStrategy":"validation","validationCode":"// Pebble: only kestra:///, file://, namespace:// are allowed\n{% set u = outputs.x.uri %}{{ (u starts with 'kestra://' or u starts with 'namespace://' or u starts with 'file://') ? read(u) : '' }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["read() is internal-storage only; use an HTTP task for remote URLs.","Validate the scheme is kestra/file/namespace before calling read.","Convert remote content into internal storage first."],"tags":["pebble","function","uri","scheme","internal-storage"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}