{"record":{"id":"4a1a0c93aca7ac0f","repo":"HMCL-dev/HMCL","slug":"invalid-library-path","errorCode":null,"errorMessage":"Invalid library path: ","messagePattern":"Invalid library path: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameLauncher.java","lineNumber":196,"sourceCode":"                result.add(\"-javaagent:\" + extractLwjglUnsafeAgent());\n            } catch (Exception e) {\n                LOG.warning(\"Failed to extract lwjgl-unsafe-agent\", e);\n            }\n        }\n    }\n\n    private Path extractLwjglUnsafeAgent() throws IOException {\n        String agentVersion = JarUtils.getAttribute(\"hmcl.lwjgl-unsafe-agent.version\", null);\n        if (agentVersion == null) {\n            throw new IOException(\"Missing hmcl.lwjgl-unsafe-agent.version attribute\");\n        }\n\n        Library library = new Library(new Artifact(\"org.glavo\", \"lwjgl-unsafe-agent\", agentVersion));\n        String fileName = library.artifact().getFileName();\n\n        Path agentPath = instance.getLayout().getLibraryFile(instance.getId(), library).toAbsolutePath().normalize();\n        if (agentPath.toString().contains(\"=\")) {\n            throw new IOException(\"Invalid library path: \" + agentPath);\n        }\n\n        byte[] bytes;\n        try (InputStream input = DefaultLauncher.class.getResourceAsStream(\"/assets/\" + fileName)) {\n            if (input == null) {\n                throw new IOException(\"/assets/\" + fileName + \" not found\");\n            }\n\n            bytes = input.readAllBytes();\n        }\n\n        if (Files.isRegularFile(agentPath)) {\n            try {\n                if (Files.size(agentPath) == bytes.length) {\n                    return agentPath;\n                }\n            } catch (IOException e) {\n                LOG.warning(\"Failed to check size of \" + agentPath, e);","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameLauncher.java#L178-L214","documentation":"Validation failure while parsing an Mcbbs modpack manifest: the manifestType field must equal 'minecraftModpack'. Thrown as JsonParseException during McbbsModpackManifest.validate() after deserializing the pack's manifest JSON.","triggerScenarios":"Reading an mcbbs.packmeta / manifest.json whose manifestType field is missing, misspelled, or set to something other than \"minecraftModpack\".","commonSituations":"Importing a modpack that only loosely follows the Mcbbs spec; hand-edited manifest files; packs generated by tools writing a different manifestType; truncated JSON.","solutions":["Set \"manifestType\": \"minecraftModpack\" in the manifest JSON","Re-download the modpack from its source","Verify you are importing an Mcbbs-format pack, not a CurseForge/Modrinth pack","Validate the JSON is complete and not truncated"],"exampleFix":"// before\n{\"manifestType\": \"modpack\", ...}\n// after\n{\"manifestType\": \"minecraftModpack\", ...}","handlingStrategy":"validation","validationCode":"JsonObject manifest = JsonUtils.fromJson(manifestJson, JsonObject.class);\nif (!\"minecraftModpack\".equals(manifest.get(\"manifestType\").getAsString()))\n    throw new IllegalArgumentException(\"Not an Mcbbs manifest\");","typeGuard":null,"tryCatchPattern":"try { manifest.validate(); } catch (JsonParseException e) { /* reject pack, show user the manifest error */ }","preventionTips":["Only import packs from Mcbbs-compliant exporters","Validate manifests before distribution","Check manifestType first when auto-detecting pack format"],"tags":["modpack","manifest","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"}