HMCL-dev/HMCL · error · JsonParseException

MinecraftInstanceConfiguration missing `manifest`

Error message

MinecraftInstanceConfiguration missing `manifest`

What it means

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.

Solutions

  1. Add a complete `manifest` object (with name, version, author, and file lists) to modpack.json.
  2. Regenerate the modpack with the official modpack export tool instead of editing JSON by hand.
  3. Check the key spelling/casing is exactly `manifest` (lowercase).
  4. Re-export/re-download the modpack archive; the current modpack.json may be truncated.

Example fix

// before (modpack.json)
// { "type": "minecraftInstance" }
// after
// { "type": "minecraftInstance", "manifest": { "name": "MyPack", "version": "1.0", "author": "me", "files": [] } }
Defensive patterns

Strategy: validation

Validate before calling

try {
    ModpackConfiguration cfg = GSON.fromJson(json, ModpackConfiguration.class);
    cfg.validate();
} catch (JsonParseException e) {
    // modpack.json missing manifest — reject or regenerate the pack
}

Try / catch

try {
    config.validate();
} catch (JsonParseException e) {
    if (e.getMessage().contains("missing `manifest`")) {
        // rebuild the modpack or fix modpack.json
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of HMCL-dev/HMCL@24702dc5a0 (2026-09-10). Data as JSON: /api/errors/63048bb21e75e17c. Report an issue: GitHub.

Appendix: source

Thrown at HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/ModpackConfiguration.java:92

        return new ModpackConfiguration<>(manifest, type, name, version, overrides);
    }

    public ModpackConfiguration<T> setOverrides(List<FileInformation> overrides) {
        return new ModpackConfiguration<>(manifest, type, name, version, overrides);
    }

    public ModpackConfiguration<T> setVersion(String version) {
        return new ModpackConfiguration<>(manifest, type, name, version, overrides);
    }

    public List<FileInformation> getOverrides() {
        return Collections.unmodifiableList(overrides);
    }

    @Override
    public void validate() throws JsonParseException {
        if (manifest == null)
            throw new JsonParseException("MinecraftInstanceConfiguration missing `manifest`");
        if (type == null)
            throw new JsonParseException("MinecraftInstanceConfiguration missing `type`");
    }

    @Immutable
    public static class FileInformation implements Validation {
        private final String path; // relative
        private final String hash;
        private final String downloadURL;

        public FileInformation() {
            this(null, null);
        }

        public FileInformation(String path, String hash) {
            this(path, hash, null);
        }

View on GitHub (pinned to 24702dc5a0)