HMCL-dev/HMCL · error · IllegalArgumentException

Instance is not a Mcbbs modpack. Cannot update this…

Error message

Instance  is not a Mcbbs modpack. Cannot update this instance.

What it means

Constructor guard: an update (as opposed to a fresh install) was requested for the instance, but its modpack configuration file is missing or declares a different provider type, so the instance is not an MCBBS modpack and cannot be updated in place.

Solutions

  1. Install the modpack as a new instance instead of updating
  2. Verify the instance's modpack configuration file exists and was created by MCBBS modpack installation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/mcbbs/McbbsModpackLocalInstallTask.java:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/mcbbs/McbbsModpackLocalInstallTask.java:122

Path json = repository.getLayout().getModpackConfigurationFile(instanceId);
if (this.updateTarget != null && Files.notExists(json))
    throw new IllegalArgumentException("Instance " + instanceId + " is not a Mcbbs modpack. Cannot update this instance.");

@Nullable ModpackConfiguration<McbbsModpackManifest> config = null;
try {
    if (this.updateTarget != null && Files.exists(json)) {
        config = JsonUtils.fromJsonFile(json, ModpackConfiguration.typeOf(McbbsModpackManifest.class));

        if (config == null || !McbbsModpackProvider.INSTANCE.getName().equals(config.getType()))
            throw new IllegalArgumentException("Instance " + instanceId + " is not a Mcbbs modpack. Cannot update this instance.");
    }
} catch (JsonParseException | IOException ignore) {
}

View on GitHub (pinned to 24702dc5a0)