{"record":{"id":"3720d1f65fb935d3","repo":"kestra-io/kestra","slug":"revision-revision-of-file-filepath-was-not-f","errorCode":null,"errorMessage":"Revision {revision} of file '{filePath}' was not found in namespace '{namespace}'.","messagePattern":"Revision (.+?) of file '(.+?)' was not found in namespace '(.+?)'\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/FileURIFunction.java","lineNumber":72,"sourceCode":"    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            }\n            try {\n                namespaceStorage.getFileContent(filePath, revision).close();\n            } catch (FileNotFoundException e) {\n                throw new FileNotFoundException(\"Revision \" + revision + \" of file '\" + filePath + \"' was not found in namespace '\" + namespace + \"'.\");\n            }\n            NamespaceFile namespaceFile = NamespaceFile.of(namespace, filePath, revision);\n            return namespaceFile.uri().toString();\n        } else {\n            NamespaceFile namespaceFile = namespaceStorage.get(filePath);\n            return namespaceFile.uri().toString();\n        }\n    }\n\n    @Override\n    protected String getErrorMessage() {\n        return ERROR_MESSAGE;\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":87,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/FileURIFunction.java#L54-L87","documentation":"Thrown by 'fileURI' when namespaceStorage.getFileContent(filePath, revision) raises FileNotFoundException, re-thrown with a message naming the revision, file path, and namespace. It confirms that the requested revision does not exist in namespace file storage; note the literal string uses concatenation (not the {placeholder} syntax), so the message includes the actual values.","triggerScenarios":"Requesting a revision number that does not exist for the namespace file (too high, or a revision of a file that has since been deleted); pointing at a file path that has no revisions; passing a revision for a file that lives in a different namespace.","commonSituations":"Hard-coding a revision from an earlier deployment after the file was recreated/deleted; using an execution variable that resolved to a stale revision; namespace mismatch where the file exists elsewhere.","solutions":["Omit 'revision' to get the current version, or look up the valid revisions of the namespace file first.","Confirm the file path is correct and lives in the namespace you are referencing.","If you need a pinned revision, verify it exists (e.g. via the UI/API namespace files history) before referencing it."],"exampleFix":"# before\nuri: \"{{ fileURI('namespace:///gone.yaml', revision=99) }}\"\n# after - use current version\nuri: \"{{ fileURI('namespace:///gone.yaml') }}\"","handlingStrategy":"validation","validationCode":"# Verify the revision exists (or omit it) before calling fileURI() with a pinned revision.\n# {{ hasRevision ? fileURI(path, revision=rev) : fileURI(path) }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit 'revision' to use the current version when unsure.","Confirm the file path and namespace are correct.","Check namespace file revision history before pinning a revision.","Avoid hard-coded revisions that may go stale after file changes."],"tags":["pebble","file","fileuri","namespace","revision","not-found","storage"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}