{"record":{"id":"8c2b6e06a27dd286","repo":"HMCL-dev/HMCL","slug":"instance","errorCode":null,"errorMessage":"Instance ","messagePattern":"Instance ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLModpackInstallTask.java","lineNumber":113,"sourceCode":"            HMCLGameRepository repository,\n            Path zipFile,\n            Modpack modpack,\n            GameInstanceID instanceId,\n            @Nullable DefaultGameInstance updateTarget) {\n        this.repository = repository;\n        this.dependency = repository.getDependency();\n        this.zipFile = zipFile;\n        this.instanceId = instanceId;\n        this.updateTarget = updateTarget;\n        this.modpack = modpack;\n        if (this.updateTarget != null) {\n            dependency.validateGameInstance(this.updateTarget);\n        }\n\n        Path run = repository.getLayout().getInstanceRoot(this.instanceId);\n        Path json = repository.getLayout().getModpackConfigurationFile(this.instanceId);\n        if (this.updateTarget != null && Files.notExists(json))\n            throw new IllegalArgumentException(\"Instance \" + instanceId + \" is not a HMCL modpack. Cannot update this instance.\");\n\n        @Nullable ModpackConfiguration<Modpack> config = null;\n        try {\n            if (this.updateTarget != null && Files.exists(json)) {\n                config = JsonUtils.fromJsonFile(json, ModpackConfiguration.typeOf(Modpack.class));\n\n                if (config == null || !HMCLModpackProvider.INSTANCE.getName().equals(config.getType()))\n                    throw new IllegalArgumentException(\"Instance \" + instanceId + \" is not a HMCL modpack. Cannot update this instance.\");\n            }\n        } catch (JsonParseException | IOException ignore) {\n        }\n\n        onDone().register(event -> {\n            if (this.updateTarget == null && event.isFailed()) {\n                repository.removeInstanceFromDisk(this.instanceId);\n            }\n        });\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLModpackInstallTask.java#L95-L131","documentation":"Validation failure for a CurseForge-backed file entry in an Mcbbs manifest: a CurseFile must carry both a non-zero projectID and fileID. These IDs are needed to download the file from CurseForge, so a zero/absent ID makes the entry unusable and validate() throws JsonParseException.","triggerScenarios":"Importing a pack where a files[] entry of type curseforge has projectID == 0 or fileID == 0 (typically because the IDs were missing in the JSON and defaulted to 0 as primitives).","commonSituations":"Hand-written manifest entries for CurseForge mods with IDs omitted; tools that failed to resolve CurseForge IDs during export; packs whose CurseForge links were replaced by placeholders.","solutions":["Fill in the correct numeric projectID and fileID from the CurseForge file page/API","Remove the entry if the file should not be part of the pack","Re-export the pack with a tool that resolves CurseForge IDs","Replace the curseforge entry with a direct URL (type=direct) if IDs are unavailable"],"exampleFix":"// before\n{\"type\": \"curseforge\", \"projectID\": 0, \"fileID\": 0}\n// after\n{\"type\": \"curseforge\", \"projectID\": 238222, \"fileID\": 2745063}","handlingStrategy":"validation","validationCode":"for (var f : manifest.getFiles())\n    if (f.getDownloads() != null && f.getType() == Type.CURSE)\n        if (f.getCurseFile().getProjectID() == 0 || f.getCurseFile().getFileID() == 0)\n            throw new IllegalArgumentException(\"CurseForge entry missing IDs: \" + f.getPath());","typeGuard":"boolean validCurseFile = e.projectID != 0 && e.fileID != 0;","tryCatchPattern":"try { manifest.validate(); } catch (JsonParseException e) { /* surface the offending curseforge entry */ }","preventionTips":["Resolve CurseForge IDs during export, never leave 0","Spot-check curseforge entries in exported packs","Fall back to direct URLs when IDs can't be resolved"],"tags":["modpack","curseforge","validation"],"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-15T23:17:13.987Z"}