{"record":{"id":"97224d706b78d2db","repo":"apache/flink","slug":"e-getmessage","errorCode":null,"errorMessage":"{e.getMessage()}","messagePattern":"\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"ProgramInvocationException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java","lineNumber":621,"sourceCode":"                            final String name = jarEntry.getName();\n                            return name.length() > 8\n                                    && name.startsWith(\"lib/\")\n                                    && name.endsWith(\".jar\");\n                        })\n                .collect(Collectors.toList());\n    }\n\n    private static void deleteExtractedLibraries(List<File> tempLibraries) {\n        for (File f : tempLibraries) {\n            f.delete();\n        }\n    }\n\n    private static void checkJarFile(URL jarfile) throws ProgramInvocationException {\n        try {\n            JarUtils.checkJarFile(jarfile);\n        } catch (IOException e) {\n            throw new ProgramInvocationException(e.getMessage(), e);\n        } catch (Throwable t) {\n            throw new ProgramInvocationException(\n                    \"Cannot access jar file\"\n                            + (t.getMessage() == null ? \".\" : \": \" + t.getMessage()),\n                    t);\n        }\n    }\n\n    @Override\n    public void close() {\n        try {\n            userCodeClassLoader.close();\n        } catch (IOException e) {\n            LOG.debug(\"Error while closing user-code classloader.\", e);\n        }\n        try {\n            deleteExtractedLibraries();\n        } catch (Exception e) {","sourceCodeStart":603,"sourceCodeEnd":639,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java#L603-L639","documentation":"Thrown when JarUtils.checkJarFile(jarUrl) throws an IOException. This check validates that the jar is a well-formed, accessible jar file. The message is passed through verbatim from the underlying IOException (e.getMessage()), so it carries the specific validation failure reason.","triggerScenarios":"Calling checkJarFile or building a PackagedProgram with a URL pointing to a file that is not a valid jar, is truncated, or has an unreadable manifest. The IOException from JarUtils carries details like 'Error opening jar file' or 'Invalid jar manifest'.","commonSituations":"Passing a plain zip (not jar), a jar that was corrupted in transit, or a URL to a remote resource that returned an HTML error page instead of a jar.","solutions":["Read the chained IOException message for the specific validation failure.","Validate the jar locally: 'jar tf your.jar' should list entries without error.","Re-download or rebuild the jar if it is corrupt.","Ensure the file is a JAR (zip with META-INF/MANIFEST.MF), not a raw zip or tar."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"try (JarFile test = new JarFile(jarFile)) {\n    if (test.getManifest() == null) {\n        throw new IllegalArgumentException(\"Jar has no manifest: \" + jarFile);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    PackagedProgram.newBuilder().setJarFile(jarFile).build();\n} catch (ProgramInvocationException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"jar\")) {\n        // jar validation failure — check integrity\n    }\n    throw e;\n}","preventionTips":["Validate jars with 'jar tf' before deployment.","Ensure uploaded/downloaded jars are complete (check file size against source).","Use HTTPS or checksum verification for jar transfers."],"tags":["packaged-program","jar","validation","io"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}