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.

Solutions

  1. Open the extensionFile named in the message and fix the syntax error (validate JSON with a linter).
  2. Regenerate the file (gradle clean + rerun the descriptor task) instead of hand-editing generated output.
  3. Restore the file from version control if a merge corrupted it.
  4. 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

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

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/9cfbcee89c819194. Report an issue: GitHub.

Appendix: 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)