quarkusio/quarkus · error · IOException
Failed to parse
Error message
Failed to parse
What it means
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.
Source
Thrown at devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java:575
return JsonMapper.builder()
.propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE)
.build();
}
private ObjectNode getMetadataNode(ObjectNode extObject) {
JsonNode mvalue = extObject.get(METADATA);
if (mvalue != null && mvalue.isObject()) {
return (ObjectNode) mvalue;
} else {
return extObject.putObject(METADATA);
}
}
private ObjectNode readExtensionFile(Path extensionFile, ObjectMapper mapper) throws IOException {
try (InputStream is = Files.newInputStream(extensionFile)) {
return mapper.readValue(is, ObjectNode.class);
} catch (IOException io) {
throw new IOException("Failed to parse " + extensionFile, io);
}
}
}
View on GitHub (pinned to e1c734241f)
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).
Example fix
// before: hand-edited file
{"name": "ext",} // trailing comma
// after
{"name": "ext"}/ Defensive patterns
Strategy: validation
Validate before calling
// validate descriptor JSON before handing it to readExtensionFile
def text = extensionFile.getText('UTF-8')
def parsed = new groovy.json.JsonSlurper().parseText(text) // throws with a clear syntax error if malformed Try / catch
try {
node = readExtensionFile(extensionFile, mapper)
} catch (IOException e) {
logger.error("${e.message} — regenerating descriptor")
Files.deleteIfExists(extensionFile)
node = regenerateAndRead(extensionFile, mapper) // regenerate instead of failing
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to parse removed resource '
- Failed to persist extension descriptor
- e.getMessage()
- Failed to persist
- Failed to load extension descriptor at
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/9cfbcee89c819194.
Report an issue: GitHub.