{"record":{"id":"3a8909189f7ad4a3","repo":"HMCL-dev/HMCL","slug":"gameremoteversion-url-cannot-be-blank","errorCode":null,"errorMessage":"GameRemoteVersion url cannot be blank","messagePattern":"GameRemoteVersion url cannot be blank","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersionInfo.java","lineNumber":46,"sourceCode":"\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":28,"sourceCodeEnd":49,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersionInfo.java#L28-L49","documentation":"GameRemoteVersionInfo.validate() throws this JsonParseException when the 'url' field of a remote version entry is blank. HMCL needs the download URL to fetch that version's JSON; a blank url makes the entry unusable.","triggerScenarios":"The remote version-list JSON contains an entry with an empty/whitespace 'url' field and validate() runs on it — typical of a broken or partially updated mirror list.","commonSituations":"Mirror (e.g. BMCLAPI) lagging behind Mojang and serving placeholder entries, proxy stripping fields, or a newly published version whose metadata has not propagated.","solutions":["Switch or refresh the version-list mirror, then re-open the version list.","Retry later if the version was just published (mirror sync lag).","Use the official Mojang meta as download source if the mirror keeps returning blank urls.","Update HMCL to the latest version."],"exampleFix":"// before: failing on one bad entry aborts the whole list\nversionList.forEach(Validation::validate);\n// after: filter unusable entries first\nversionList.stream()\n    .filter(v -> StringUtils.isNotBlank(v.getUrl()))\n    .forEach(Validation::validate);","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(entryJson.optString(\"url\"))) skipEntry(entryJson);","typeGuard":"boolean hasUrl(GameRemoteVersionInfo v) { return v != null && StringUtils.isNotBlank(v.getUrl()); }","tryCatchPattern":"try { info.validate(); } catch (JsonParseException e) { switchMirrorAndRefresh(); }","preventionTips":["Wait for mirror sync when a version was just published","Validate required fields per entry instead of failing the whole list","Maintain a fallback download source in settings"],"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"}