{"record":{"id":"5f0831e4062e2f5c","repo":"HMCL-dev/HMCL","slug":"logginginfo-argument-is-empty","errorCode":null,"errorMessage":"LoggingInfo.argument is empty.","messagePattern":"LoggingInfo\\.argument is empty\\.","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/game/LoggingInfo.java","lineNumber":49,"sourceCode":"                          @SerializedName(\"type\") String type) implements Validation {\n\n    public LoggingInfo() {\n        this(new IdDownloadInfo());\n    }\n\n    public LoggingInfo(IdDownloadInfo file) {\n        this(file, \"\");\n    }\n\n    public LoggingInfo(IdDownloadInfo file, String argument) {\n        this(file, argument, \"\");\n    }\n\n    @Override\n    public void validate() throws JsonParseException, TolerableValidationException {\n        file.validate();\n        if (StringUtils.isBlank(argument))\n            throw new JsonParseException(\"LoggingInfo.argument is empty.\");\n        if (StringUtils.isBlank(type))\n            throw new JsonParseException(\"LoggingInfo.type is empty.\");\n    }\n}\n","sourceCodeStart":31,"sourceCodeEnd":54,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/game/LoggingInfo.java#L31-L54","documentation":"LoggingInfo.validate() rejects a logging configuration whose 'argument' field is blank. The argument string is the pattern passed to the log4j agent on the command line; without it log configuration is unusable.","triggerScenarios":"Parsing a Minecraft version JSON whose logging.client.arguments member is absent, null, or an empty/whitespace string, then invoking validate().","commonSituations":"Version JSON copied from an older Minecraft version before logging info was introduced, stripped-down custom manifests, tools that remove 'empty' JSON fields.","solutions":["Provide a non-empty argument value in the logging section of the version JSON","Copy the logging block from the official version manifest for that game version","Remove the logging section entirely if the launcher tolerates missing logging info","Re-download the version JSON from Mojang's official endpoint"],"exampleFix":"// before\n\"logging\": {\"client\": {\"file\": {...}, \"type\": \"log4j2-xml\"}}\n// after\n\"logging\": {\"client\": {\"argument\": \"-Dlog4j.configurationFile=${path}\", \"file\": {...}, \"type\": \"log4j2-xml\"}}","handlingStrategy":"validation","validationCode":"if (logging != null && (logging.getArgument() == null || logging.getArgument().isBlank())) {\n    // drop or repair the logging block before constructing LoggingInfo\n}","typeGuard":"static boolean hasNonBlank(JsonObject obj, String key) {\n    return obj.has(key) && obj.get(key).isJsonPrimitive() && !obj.get(key).getAsString().isBlank();\n}","tryCatchPattern":"try {\n    loggingInfo.validate();\n} catch (JsonParseException e) {\n    if (e.getMessage().startsWith(\"LoggingInfo.argument\")) {\n        loggingInfo = null; // run without logging config\n    } else throw e;\n}","preventionTips":["Keep the complete logging block when copying version JSONs","Diff custom manifests against the official one","Treat logging info as optional and skip versions without it"],"tags":["json","validation","minecraft"],"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-15T23:17:13.987Z"}