{"record":{"id":"c64e641f20227c60","repo":"apache/flink","slug":"the-manifest-in-the-jar-file-could-not-be-accessed","errorCode":null,"errorMessage":"The Manifest in the jar file could not be accessed '{jarFile.getPath()}'. {ioex.getMessage()}","messagePattern":"The Manifest in the jar file could not be accessed '(.+?)'\\. (.+?)","errorType":"exception","errorClass":"ProgramInvocationException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java","lineNumber":413,"sourceCode":"        } catch (URISyntaxException use) {\n            throw new ProgramInvocationException(\n                    \"Invalid file path '\" + jarFile.getPath() + \"'\", use);\n        } catch (IOException ioex) {\n            throw new ProgramInvocationException(\n                    \"Error while opening jar file '\"\n                            + jarFile.getPath()\n                            + \"'. \"\n                            + ioex.getMessage(),\n                    ioex);\n        }\n\n        // jar file must be closed at the end\n        try {\n            // Read from jar manifest\n            try {\n                manifest = jar.getManifest();\n            } catch (IOException ioex) {\n                throw new ProgramInvocationException(\n                        \"The Manifest in the jar file could not be accessed '\"\n                                + jarFile.getPath()\n                                + \"'. \"\n                                + ioex.getMessage(),\n                        ioex);\n            }\n\n            if (manifest == null) {\n                throw new ProgramInvocationException(\n                        \"No manifest found in jar file '\"\n                                + jarFile.getPath()\n                                + \"'. The manifest is need to point to the program's main class.\");\n            }\n\n            Attributes attributes = manifest.getMainAttributes();\n\n            // check for a \"program-class\" entry first\n            className = attributes.getValue(PackagedProgram.MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS);","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java#L395-L431","documentation":"Thrown by getEntryPointClassNameFromJar when jar.getManifest() raises an IOException. The jar opened successfully but the META-INF/MANIFEST.MF entry could not be read — typically because the manifest is malformed or the central-directory entry is corrupt.","triggerScenarios":"The jar is a valid ZIP but its MANIFEST.MF is unreadable: corrupt manifest bytes, truncated manifest entry, or a manifest that violates the JAR spec badly enough to break the reader.","commonSituations":"A jar assembled by a buggy build tool, a manifest concatenated incorrectly, or a jar modified by a tool that corrupted META-INF. Distinct from a missing manifest (error 77).","solutions":["Inspect the appended ': <message>' for the manifest read error detail.","Rebuild the jar with a standard build tool (Maven shade/assembly, Gradle ShadowJar) to regenerate a valid manifest.","Open the jar with 'unzip -p <jar> META-INF/MANIFEST.MF' to inspect the manifest bytes for corruption.","If the jar is third-party, obtain a clean copy."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Read the manifest entry independently to validate it\ntry (JarFile jf = new JarFile(jarFile)) {\n    Manifest m = jf.getManifest();\n    if (m == null) throw new IllegalStateException(\"No manifest\");\n    if (m.getMainAttributes().getValue(\"Main-Class\") == null\n        && m.getMainAttributes().getValue(\"program-class\") == null) {\n        // no entry point attribute\n    }\n} catch (IOException ioe) {\n    throw new IllegalStateException(\"Manifest unreadable\", ioe);\n}","typeGuard":null,"tryCatchPattern":"try {\n    PackagedProgram.newBuilder().setJarFile(jarFile).build();\n} catch (ProgramInvocationException pie) {\n    if (pie.getMessage().contains(\"Manifest in the jar file could not be accessed\")) {\n        // rebuild jar with a valid manifest\n    }\n    throw pie;\n}","preventionTips":["Build jars with a standard tool (Maven shade/assembly, Gradle ShadowJar) that emits a valid manifest.","Avoid hand-editing or concatenating MANIFEST.MF.","Validate the jar with 'unzip -p <jar> META-INF/MANIFEST.MF' after build."],"tags":["packaged-program","jar","manifest","io","corruption"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}