{"record":{"id":"9cfbcee89c819194","repo":"quarkusio/quarkus","slug":"failed-to-parse","errorCode":null,"errorMessage":"Failed to parse ","messagePattern":"Failed to parse ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java","lineNumber":575,"sourceCode":"        return JsonMapper.builder()\n                .propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE)\n                .build();\n    }\n\n    private ObjectNode getMetadataNode(ObjectNode extObject) {\n        JsonNode mvalue = extObject.get(METADATA);\n        if (mvalue != null && mvalue.isObject()) {\n            return (ObjectNode) mvalue;\n        } else {\n            return extObject.putObject(METADATA);\n        }\n    }\n\n    private ObjectNode readExtensionFile(Path extensionFile, ObjectMapper mapper) throws IOException {\n        try (InputStream is = Files.newInputStream(extensionFile)) {\n            return mapper.readValue(is, ObjectNode.class);\n        } catch (IOException io) {\n            throw new IOException(\"Failed to parse \" + extensionFile, io);\n        }\n    }\n}\n","sourceCodeStart":557,"sourceCodeEnd":579,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java#L557-L579","documentation":"Declared by ExtensionDescriptorTask.readExtensionFile, this IOException wraps parse failures when reading an existing extension descriptor file (quarkus-extension.properties/json) with a Jackson ObjectMapper into an ObjectNode. The original path is preserved as the message so the offending file is identified.","triggerScenarios":"Files.newInputStream succeeds but mapper.readValue throws because the file content is not valid JSON/properties for the expected mapper — truncated or hand-edited descriptor files, wrong-format file passed as extensionFile, or encoding corruption.","commonSituations":"Manually edited quarkus-extension files with syntax errors, partial writes from an earlier failed build, or merging conflicts in generated descriptor files left malformed in the source/resources tree.","solutions":["Open the extensionFile named in the message and fix the syntax error (validate JSON with a linter).","Regenerate the file (gradle clean + rerun the descriptor task) instead of hand-editing generated output.","Restore the file from version control if a merge corrupted it.","Ensure the correct ObjectMapper/format is used for that file (JSON mapper vs properties mapper)."],"exampleFix":"// before: hand-edited file\n{\"name\": \"ext\",}  // trailing comma\n// after\n{\"name\": \"ext\"}/","handlingStrategy":"validation","validationCode":"// validate descriptor JSON before handing it to readExtensionFile\ndef text = extensionFile.getText('UTF-8')\ndef parsed = new groovy.json.JsonSlurper().parseText(text) // throws with a clear syntax error if malformed","typeGuard":null,"tryCatchPattern":"try {\n  node = readExtensionFile(extensionFile, mapper)\n} catch (IOException e) {\n  logger.error(\"${e.message} — regenerating descriptor\")\n  Files.deleteIfExists(extensionFile)\n  node = regenerateAndRead(extensionFile, mapper) // regenerate instead of failing\n}","preventionTips":["Never hand-edit generated quarkus-extension files; regenerate them instead.","Resolve merge conflicts in generated files by regenerating, not by manual editing.","Validate JSON files in the repo with a linter in CI to catch syntax errors early.","Run gradle clean if a previous build failed mid-write and left truncated output."],"tags":["gradle","json","parse-error","descriptor"],"backgroundTag":"json-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}