{"record":{"id":"63048bb21e75e17c","repo":"HMCL-dev/HMCL","slug":"minecraftinstanceconfiguration-missing-manifest","errorCode":null,"errorMessage":"MinecraftInstanceConfiguration missing `manifest`","messagePattern":"MinecraftInstanceConfiguration missing `manifest`","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/ModpackConfiguration.java","lineNumber":92,"sourceCode":"        return new ModpackConfiguration<>(manifest, type, name, version, overrides);\n    }\n\n    public ModpackConfiguration<T> setOverrides(List<FileInformation> overrides) {\n        return new ModpackConfiguration<>(manifest, type, name, version, overrides);\n    }\n\n    public ModpackConfiguration<T> setVersion(String version) {\n        return new ModpackConfiguration<>(manifest, type, name, version, overrides);\n    }\n\n    public List<FileInformation> getOverrides() {\n        return Collections.unmodifiableList(overrides);\n    }\n\n    @Override\n    public void validate() throws JsonParseException {\n        if (manifest == null)\n            throw new JsonParseException(\"MinecraftInstanceConfiguration missing `manifest`\");\n        if (type == null)\n            throw new JsonParseException(\"MinecraftInstanceConfiguration missing `type`\");\n    }\n\n    @Immutable\n    public static class FileInformation implements Validation {\n        private final String path; // relative\n        private final String hash;\n        private final String downloadURL;\n\n        public FileInformation() {\n            this(null, null);\n        }\n\n        public FileInformation(String path, String hash) {\n            this(path, hash, null);\n        }\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/ModpackConfiguration.java#L74-L110","documentation":"ModpackConfiguration (modpack.json for Minecraft instance modpacks) implements Validation; validate() throws JsonParseException(\"MinecraftInstanceConfiguration missing `manifest`\") when the parsed configuration has no manifest object. Without the manifest the launcher cannot know which files the modpack contains or which Minecraft version to set up.","triggerScenarios":"Calling validate() on a ModpackConfiguration deserialized from a modpack.json that lacks the top-level `manifest` key, or where it was serialized as null — typically a hand-written or hand-edited modpack.json.","commonSituations":"Manually authoring a modpack and forgetting the manifest section; a modpack builder crashing before writing manifest; JSON key renamed/misspelled (e.g. \"Manifest\"); truncation during packaging.","solutions":["Add a complete `manifest` object (with name, version, author, and file lists) to modpack.json.","Regenerate the modpack with the official modpack export tool instead of editing JSON by hand.","Check the key spelling/casing is exactly `manifest` (lowercase).","Re-export/re-download the modpack archive; the current modpack.json may be truncated."],"exampleFix":"// before (modpack.json)\n// { \"type\": \"minecraftInstance\" }\n// after\n// { \"type\": \"minecraftInstance\", \"manifest\": { \"name\": \"MyPack\", \"version\": \"1.0\", \"author\": \"me\", \"files\": [] } }","handlingStrategy":"validation","validationCode":"try {\n    ModpackConfiguration cfg = GSON.fromJson(json, ModpackConfiguration.class);\n    cfg.validate();\n} catch (JsonParseException e) {\n    // modpack.json missing manifest — reject or regenerate the pack\n}","typeGuard":null,"tryCatchPattern":"try {\n    config.validate();\n} catch (JsonParseException e) {\n    if (e.getMessage().contains(\"missing `manifest`\")) {\n        // rebuild the modpack or fix modpack.json\n    }\n}","preventionTips":["Always export modpacks with the official packaging tool","Validate modpack.json against the schema before distribution","Keep the exact lowercase key names (`manifest`, `type`)"],"tags":["modpack","json","validation","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}