quarkusio/quarkus · error · RuntimeException

Failed to deserialize platform descriptor ${json}

Error message

Failed to deserialize platform descriptor ${json}

What it means

Thrown by ToolsUtils.mergePlatforms when a platform descriptor was downloaded successfully but ExtensionCatalog.fromFile(json) cannot deserialize the file. The cause chain contains the Jackson/IO error explaining why the JSON is invalid or incompatible.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java:246

        return mergePlatforms(platforms, new BootstrapAppModelResolver(artifactResolver));
    }

    public static ExtensionCatalog mergePlatforms(List<ArtifactCoords> platforms, AppModelResolver artifactResolver) {
        // TODO remove this method once we have the registry service available
        List<ExtensionCatalog> catalogs = new ArrayList<>(platforms.size());
        for (ArtifactCoords platform : platforms) {
            final Path json;
            try {
                json = artifactResolver.resolve(ArtifactCoords.of(platform.getGroupId(), platform.getArtifactId(),
                        platform.getClassifier(), platform.getType(), platform.getVersion())).getResolvedPaths()
                        .getSinglePath();
            } catch (Exception e) {
                throw new RuntimeException("Failed to resolve platform descriptor " + platform, e);
            }
            try {
                catalogs.add(ExtensionCatalog.fromFile(json));
            } catch (IOException e) {
                throw new RuntimeException("Failed to deserialize platform descriptor " + json, e);
            }
        }
        return CatalogMergeUtility.merge(catalogs);
    }

    @SuppressWarnings("unchecked")
    public static Properties readQuarkusProperties(ExtensionCatalog catalog) {
        Map<Object, Object> map = (Map<Object, Object>) catalog.getMetadata().getOrDefault("project", Collections.emptyMap());
        map = (Map<Object, Object>) map.getOrDefault("properties", Collections.emptyMap());
        final Properties properties = new Properties();
        map.entrySet().forEach(
                e -> properties.setProperty(e.getKey().toString(), e.getValue() == null ? null : e.getValue().toString()));
        return properties;
    }

    @SuppressWarnings("unchecked")
    public static Map<String, Object> readProjectData(ExtensionCatalog catalog) {
        Map<Object, Object> map = (Map<Object, Object>) catalog.getMetadata().getOrDefault("project", Map.of());

View on GitHub (pinned to e1c734241f)

Solutions

  1. Remove the cached artifact from ~/.m2/repository and re-run to get a fresh copy
  2. Verify the resolved file is the platform descriptor JSON, not a POM
  3. Upgrade/downgrade the devtools-common/registry-client version to match the platform release
  4. Open the JSON and validate it parses (e.g. jq) to confirm corruption

Example fix

// before
rm nothing; reuse corrupted cache
// after
cd ~/.m2/repository/io/quarkus/platform/quarkus-bom && rm -rf <bad-version>  # then re-run mergePlatforms
Defensive patterns

Strategy: try-catch

Validate before calling

Path json = ...;
if (!Files.isRegularFile(json)) throw new IllegalStateException("Not a file: " + json);
new ObjectMapper().readTree(Files.newInputStream(json)); // pre-validate JSON parseability

Try / catch

try {
    mergePlatforms(platforms);
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("Failed to deserialize platform descriptor")) {
        // delete the cached file named in the message from ~/.m2 and retry
    }
    throw e;
}

Prevention

When it happens

Trigger: ExtensionCatalog.fromFile throws IOException on the resolved platform JSON — malformed JSON, truncated download, wrong artifact type resolved, or catalog schema mismatch with the reading library version.

Common situations: Manually edited or corrupted files in the local Maven cache; resolving the POM rather than the 'json' typed descriptor; version skew between platform and devtools tools.

Related errors


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