{"record":{"id":"05d88f1d4fa35b4a","repo":"HMCL-dev/HMCL","slug":"gameremoteversion-id-cannot-be-blank","errorCode":null,"errorMessage":"GameRemoteVersion id cannot be blank","messagePattern":"GameRemoteVersion id cannot be blank","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersionInfo.java","lineNumber":44,"sourceCode":"\nimport java.time.Instant;\n\n/**\n *\n * @author huangyuhui\n */\n@JsonSerializable\npublic record GameRemoteVersionInfo(\n        @SerializedName(\"id\") String gameVersion,\n        @SerializedName(\"time\") Instant time,\n        @SerializedName(\"releaseTime\") Instant releaseTime,\n        @SerializedName(\"type\") ReleaseType type,\n        @SerializedName(\"url\") String url) implements Validation {\n\n    @Override\n    public void validate() throws JsonParseException {\n        if (StringUtils.isBlank(gameVersion))\n            throw new JsonParseException(\"GameRemoteVersion id cannot be blank\");\n        if (StringUtils.isBlank(url))\n            throw new JsonParseException(\"GameRemoteVersion url cannot be blank\");\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":49,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersionInfo.java#L26-L49","documentation":"GameRemoteVersionInfo.validate() throws this JsonParseException when the 'id' field (mapped from gameVersion, message says 'id') is blank in the parsed remote version-list entry. HMCL requires a non-blank identifier to key the version entry; a blank id makes the list entry invalid.","triggerScenarios":"The remote version-list JSON (official Mojang or a mirror like BMCLAPI) contains an entry with an empty or whitespace-only 'id' field, and validate() runs on the deserialized record.","commonSituations":"Mirror returning degraded/incomplete version lists, upstream adding new entry shapes HMCL does not expect, or a proxy injecting malformed JSON.","solutions":["Refresh the version list from a different mirror (switch download source in HMCL settings).","Retry after transient mirror issues; official Mojang meta is usually well-formed.","Update HMCL so its parser/expectations match the current remote list format."],"exampleFix":"// before: trusting every list entry\nList<GameRemoteVersionInfo> list = JsonUtils.fromJson(json, LIST_TYPE);\nlist.forEach(Validation::validate);\n// after: skip malformed entries\nlist.stream().filter(v -> StringUtils.isNotBlank(v.getId()))\n    .forEach(Validation::validate);","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(entryJson.optString(\"id\"))) skipEntry(entryJson);","typeGuard":"boolean hasId(GameRemoteVersionInfo v) { return v != null && StringUtils.isNotBlank(v.getId()); }","tryCatchPattern":"try { info.validate(); } catch (JsonParseException e) { refreshVersionListFromMirror(); }","preventionTips":["Filter list entries for blank required fields before validating all","Prefer official Mojang meta over flaky mirrors","Refresh the version list on parse failures rather than aborting"],"tags":["json","validation","remote-version","mirror"],"backgroundTag":"empty-required-field","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"}