{"record":{"id":"7de43e940f8d5442","repo":"kestra-io/kestra","slug":"cannot-process-the-uri-s-scheme-not-supported-7de43e","errorCode":null,"errorMessage":"Cannot process the URI %s: scheme not supported.","messagePattern":"Cannot process the URI (.+?): scheme not supported\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/IsFileEmptyFunction.java","lineNumber":44,"sourceCode":"            case StorageContext.KESTRA_SCHEME -> {\n                try (InputStream inputStream = storageInterface.get().get(tenantId, namespace, path)) {\n                    byte[] buffer = new byte[1];\n                    yield inputStream.read(buffer, 0, 1) <= 0;\n                }\n            }\n            case LocalPath.FILE_SCHEME -> {\n                try (InputStream inputStream = localPathFactory.get().createLocalPath().get(path)) {\n                    byte[] buffer = new byte[1];\n                    yield inputStream.read(buffer, 0, 1) <= 0;\n                }\n            }\n            case Namespace.NAMESPACE_FILE_SCHEME -> {\n                FileAttributes fileAttributes = namespaceFactory.get()\n                    .of(tenantId, namespace, storageInterface.get())\n                    .getFileMetadata(NamespaceFile.normalize(Path.of(path.getPath())));\n                yield fileAttributes.getSize() <= 0;\n            }\n            default -> throw new IllegalArgumentException(SCHEME_NOT_SUPPORTED_ERROR.formatted(path));\n        };\n    }\n\n    @Override\n    protected String getErrorMessage() {\n        return ERROR_MESSAGE;\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/IsFileEmptyFunction.java#L26-L53","documentation":"The isFileEmpty function only handles three URI schemes: 'kestra://' (internal storage), 'file://' (local files, if enabled), and 'nsfile://' (namespace files). Any other scheme reaches the switch default and throws. The IllegalArgumentException is caught and rethrown by AbstractFileFunction as a PebbleException with the same message.","triggerScenarios":"Passing a path like 's3://bucket/key', 'http://example.com/file', or any URI whose scheme is not kestra, file, or nsfile.","commonSituations":"Assuming the function reads arbitrary remote URLs or cloud object stores; passing a plain 'https://' URL; or passing a URI object constructed with a foreign scheme.","solutions":["Use a 'kestra://' internal-storage URI, an 'nsfile://' namespace-file URI, or a relative namespace path string.","For remote URLs, download the file into internal storage first, then check emptiness.","If you need 'file://', enable local file functions in the Kestra configuration (kestra.plugins.local-files.enableFileFunctions)."],"exampleFix":"// before\n{{ isFileEmpty('https://example.com/data.csv') }}\n// after — check an internal-storage URI\n{{ isFileEmpty('kestra:///com.acme/myflow/executions/.../tasks/.../data.csv') }}","handlingStrategy":"validation","validationCode":"{% set s = myPath|slice(0, 7) %}{% if s in ['kestra:', 'nsfile:', 'file://'] %}{{ isFileEmpty(myPath) }}{% else %}unsupported-scheme{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only 'kestra://', 'nsfile://', or (if enabled) 'file://' URIs, or a relative namespace path.","Download remote URLs into internal storage before checking emptiness.","Remember isFileEmpty does not read arbitrary http/s3/gs URLs."],"tags":["pebble","storage","uri","scheme","file"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}