{"record":{"id":"03be203be314726d","repo":"apache/flink","slug":"jar-file-does-not-exist-03be20","errorCode":null,"errorMessage":"JAR file does not exist '{}'","messagePattern":"JAR file does not exist '(.+?)'","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/util/JarUtils.java","lineNumber":46,"sourceCode":"import java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.jar.JarFile;\nimport java.util.stream.Collectors;\n\n/** Utility functions for jar files. */\n@Internal\npublic class JarUtils {\n\n    public static void checkJarFile(URL jar) throws IOException {\n        File jarFile;\n        try {\n            jarFile = new File(jar.toURI());\n        } catch (URISyntaxException e) {\n            throw new IOException(\"JAR file path is invalid '\" + jar + '\\'');\n        }\n        if (!jarFile.exists()) {\n            throw new IOException(\"JAR file does not exist '\" + jarFile.getAbsolutePath() + '\\'');\n        }\n        if (!jarFile.canRead()) {\n            throw new IOException(\"JAR file can't be read '\" + jarFile.getAbsolutePath() + '\\'');\n        }\n\n        try (JarFile ignored = new JarFile(jarFile)) {\n            // verify that we can open the Jar file\n        } catch (IOException e) {\n            throw new IOException(\n                    \"Error while opening jar file '\" + jarFile.getAbsolutePath() + '\\'', e);\n        }\n    }\n\n    public static List<URL> getJarFiles(final String[] jars) {\n        if (jars == null) {\n            return Collections.emptyList();\n        }\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/util/JarUtils.java#L28-L64","documentation":"JarUtils.checkJarFile verifies the jar URL points to an existing file. After converting the URL to a File, if !jarFile.exists() this IOException is thrown with the absolute path that was checked. It is the standard failure when a user-supplied jar path points to nothing on disk.","triggerScenarios":"Calling checkJarFile (or a wrapper like ClientUtils, LiquibaseSqlProgram, or -C/-pyexecjar processing that resolves jar paths) with a URL/absolute path naming a file that does not exist on the node performing the check.","commonSituations":"Relative jar path resolved against the wrong working directory on a remote JobManager; typo in the -C or --jar argument; jar deleted or never uploaded to the cluster (path valid locally but absent on the server); container image missing the dependency.","solutions":["Verify the absolute path printed in the message actually exists on the machine running the check (JobManager for cluster submissions, not your laptop).","Use an absolute path or ship the jar inside the job submission/user jar instead of referencing a cluster-local file.","Fix typos in the jar path in the CLI argument or configuration (e.g. pipeline.jars, python.executable.jars).","If running in containers/K8s, make sure the jar is present in the image or mounted volume at that path."],"exampleFix":"# before\nflink run -c MainClass app.jar -C libs/my-connector.jar   # file missing on cluster\n\n# after: bundle the connector in the uber jar, or upload it with the job\nflink run -c MainClass app-with-deps.jar","handlingStrategy":"validation","validationCode":"Path p = Paths.get(jarUrl.toURI());\nif (!Files.exists(p)) {\n    throw new FileNotFoundException(\"Jar not found on this node: \" + p.toAbsolutePath());\n}\nJarUtils.checkJarFile(jarUrl);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for cluster-local jars","Verify jar existence on the executing node (JobManager), not the client","Prefer bundling dependencies in the uber jar over cluster-local paths"],"tags":["jar","classpath","file-not-found","deployment"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}