{"record":{"id":"e2d850a3edac7c02","repo":"kestra-io/kestra","slug":"cannot-process-the-uri-s-scheme-not-supported-e2d850","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/FileURIFunction.java","lineNumber":50,"sourceCode":"        ).toList();\n    }\n\n    @Override\n    public Map<String, String> getArgumentDefaults() {\n        HashMap<String, String> defaults = new HashMap<>();\n        defaults.put(PATH, \"'a/namespace/file'\");\n        defaults.put(NAMESPACE, null);\n        defaults.put(REVISION, null);\n        return defaults;\n    }\n\n    @Override\n    protected Object fileFunction(EvaluationContext context, URI path, String namespace, String tenantId, Map<String, Object> args) throws IOException {\n        return switch (path.getScheme()) {\n            case StorageContext.KESTRA_SCHEME -> path.toString();\n            case LocalPath.FILE_SCHEME -> path.toString();\n            case Namespace.NAMESPACE_FILE_SCHEME -> getNamespaceFileURI(path, namespace, tenantId, args);\n            default -> throw new IllegalArgumentException(SCHEME_NOT_SUPPORTED_ERROR.formatted(path));\n        };\n    }\n\n    private String getNamespaceFileURI(URI path, String namespace, String tenantId, Map<String, Object> args) throws IOException {\n        String pathStr = path.getPath();\n        if (pathStr.contains(\"../\")) {\n            throw new IllegalArgumentException(\"Path must not contain '../'\");\n        }\n        Namespace namespaceStorage = namespaceFactory.get().of(tenantId, namespace, storageInterface.get());\n        Path filePath = NamespaceFile.normalize(Path.of(pathStr));\n\n        if (args.containsKey(REVISION)) {\n            Integer revision;\n            try {\n                revision = Integer.parseInt(args.get(REVISION).toString());\n            } catch (NumberFormatException e) {\n                throw new IllegalArgumentException(\"The 'fileURI' function expects the 'revision' argument to be a valid integer.\");\n            }","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/FileURIFunction.java#L32-L68","documentation":"Thrown by the 'fileURI' function when the resolved URI scheme is not kestra://, file:// (local), or the namespace file scheme. For kestra:// and file:// it returns the URI as-is; for namespace files it resolves and returns a concrete URI (optionally pinned to a revision). An unsupported scheme hits the default branch and throws IllegalArgumentException.","triggerScenarios":"Calling fileURI() with an external URL scheme (http, https, s3, gs, ftp) or any non-handled scheme; passing a string that does not parse into one of the supported internal schemes.","commonSituations":"Using fileURI() to normalize an external download URL; confusing it with a fetch function; passing a plugin-specific URI format.","solutions":["Pass an internal storage URI (kestra://), a local file:// URI, or a namespace file reference.","For external resources, fetch them into internal storage first and pass the resulting kestra:// URI.","For namespace files, supply the namespace file scheme so the revision/normalization logic applies."],"exampleFix":"# before\nuri: \"{{ fileURI('https://example.com/x.csv') }}\"\n# after\nuri: \"{{ fileURI(outputs.fetch.uri) }}\"","handlingStrategy":"validation","validationCode":"# Validate the scheme before calling fileURI().\n# {{ (uri starts with 'kestra://' or uri starts with 'file://' or uri starts with 'namespace://') ? fileURI(uri) : null }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass only kestra://, file://, or namespace file URIs to fileURI().","Fetch external resources into internal storage first.","Use output references that yield internal storage URIs.","Confirm the scheme is one of the three supported before the call."],"tags":["pebble","file","fileuri","storage","uri","scheme","validation"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}