{"record":{"id":"717565bafe733fda","repo":"HMCL-dev/HMCL","slug":"mmc-pack-json-malformed","errorCode":null,"errorMessage":"mmc-pack.json malformed.","messagePattern":"mmc-pack\\.json malformed\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/multimc/MultiMCManifest.java","lineNumber":64,"sourceCode":"\n    public List<MultiMCManifestComponent> getComponents() {\n        return components;\n    }\n\n    /**\n     * Read MultiMC modpack manifest from zip file\n     * @param zipFile the zip file\n     * @return the MultiMC modpack manifest.\n     * @throws IOException if zip file is malformed\n     * @throws com.google.gson.JsonParseException if manifest is malformed.\n     */\n    public static MultiMCManifest readMultiMCModpackManifest(ZipArchiveReader zipFile, String rootEntryName) throws IOException {\n        ZipArchiveEntry mmcPack = zipFile.getEntry(rootEntryName + \"mmc-pack.json\");\n        if (mmcPack == null)\n            return null;\n        MultiMCManifest manifest = JsonUtils.fromNonNullJsonFully(zipFile.getInputStream(mmcPack), MultiMCManifest.class);\n        if (manifest.getComponents() == null)\n            throw new IOException(\"mmc-pack.json malformed.\");\n\n        return manifest;\n    }\n\n    public static final class MultiMCManifestCachedRequires {\n        @SerializedName(\"equals\")\n        private final String equalsVersion;\n\n        @SerializedName(\"uid\")\n        private final String uid;\n\n        @SerializedName(\"suggests\")\n        private final String suggests;\n\n        public MultiMCManifestCachedRequires(String equalsVersion, String uid, String suggests) {\n            this.equalsVersion = equalsVersion;\n            this.uid = uid;\n            this.suggests = suggests;","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/multimc/MultiMCManifest.java#L46-L82","documentation":"readMultiMCModpackManifest successfully parses mmc-pack.json but the resulting manifest has no components array, so the archive is not a usable MultiMC modpack. HMCL treats this as an IO failure describing malformed launcher metadata.","triggerScenarios":"Importing a .zip whose mmc-pack.json parses but lacks the components field, or where components is JSON null.","commonSituations":"Truncated or partially written mmc-pack.json; instances missing component definitions because files were pruned; invalid zips produced by other tools.","solutions":["Re-download/re-export the MultiMC instance so mmc-pack.json contains a components array","Add the required components (net.minecraft etc.) to mmc-pack.json","Verify the zip entry mmc-pack.json at the expected root path is the correct file"],"exampleFix":"// before\n{ \"formatVersion\": 1 } // no components\n// after\n{ \"formatVersion\": 1, \"components\": [ { \"uid\": \"net.minecraft\", \"version\": \"1.20.1\" } ] }","handlingStrategy":"validation","validationCode":"MultiMCManifest m = JsonUtils.fromNonNullJsonFully(in, MultiMCManifest.class);\nif (m.getComponents() == null) throw new IOException(\"mmc-pack.json malformed.\");","typeGuard":null,"tryCatchPattern":"try { manifest = MultiMCManifest.readMultiMCModpackManifest(zip, root); } catch (IOException e) { /* treat as invalid modpack archive */ }","preventionTips":["Verify mmc-pack.json contains a components array before importing","Re-download truncated archives","Check the zip root path so the correct mmc-pack.json is read"],"tags":["multimc","mmc-pack","manifest","io"],"backgroundTag":"schema-validation-failed","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}