{"record":{"id":"704de7fb29e0ec74","repo":"apache/flink","slug":"file-does-not-exist-or-the-user-running-flink","errorCode":null,"errorMessage":"File {} does not exist or the user running Flink ('{}') has insufficient permissions to access it.","messagePattern":"File (.+?) does not exist or the user running Flink \\('(.+?)'\\) has insufficient permissions to access it\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java","lineNumber":100,"sourceCode":"\n    // ------------------------------------------------------------------------\n\n    @Override\n    public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len)\n            throws IOException {\n        if (file instanceof LocalFileStatus) {\n            return ((LocalFileStatus) file).getBlockLocations();\n        }\n        throw new IOException(\"File status does not belong to the LocalFileSystem: \" + file);\n    }\n\n    @Override\n    public FileStatus getFileStatus(Path f) throws IOException {\n        final File path = pathToFile(f);\n        if (path.exists()) {\n            return new LocalFileStatus(path, this);\n        } else {\n            throw new FileNotFoundException(\n                    \"File \"\n                            + f\n                            + \" does not exist or the user running \"\n                            + \"Flink ('\"\n                            + System.getProperty(\"user.name\")\n                            + \"') has insufficient permissions to access it.\");\n        }\n    }\n\n    @Override\n    public URI getUri() {\n        return LOCAL_URI;\n    }\n\n    @Override\n    public Path getWorkingDirectory() {\n        return new Path(workingDir);\n    }","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java#L82-L118","documentation":"Thrown as FileNotFoundException by LocalFileSystem.getFileStatus() when the underlying java.io.File does not exist. The message also covers the case where the file is present but the running user lacks read/permission access, since java.io.File.exists() returns false in both cases.","triggerScenarios":"Calling getFileStatus(path) where pathToFile(path) points to a non-existent local file, or to a file the current OS user cannot access/stat.","commonSituations":"Wrong checkpoint/savepoint path; path relative to wrong working directory; Flink running as a user without read permission on the target file; path with a typo or wrong scheme resolution.","solutions":["Verify the path exists on the local disk and is readable by the Flink process user: `ls -l <path>`.","Check the user running the TaskManager/JobManager has read permissions, or chown/chmod the file.","Use an absolute path; confirm working directory expectations.","If the file genuinely is gone, restore from checkpoint/savepoint or regenerate."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"void ensureReadable(LocalFileSystem fs, Path p) throws IOException {\n    File f = new File(p.toUri());\n    if (!f.exists() || !f.canRead())\n        throw new FileNotFoundException(\"Not accessible: \" + p);\n    fs.getFileStatus(p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fs.getFileStatus(p);\n} catch (FileNotFoundException e) {\n    // log and surface config/user hint, or fallback path\n    throw e;\n}","preventionTips":["Validate paths and permissions before job submission.","Run the Flink process as a user with read access to required files.","Use absolute, verified paths in configuration."],"tags":["filesystem","local-fs","permissions","file-not-found","configuration"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}