apache/cassandra · error · RuntimeException

Unable to serialize…

Error message

Unable to serialize minimum_client_driver_versions_disallowed configuration: 

What it means

Same pattern as the warned variant: getMinimumClientDriverVersionsDisallowed() fails to serialize DEFAULT_CONFIG.getMinimumClientDriverVersionsDisallowed() with Jackson and throws RuntimeException('Unable to serialize minimum_client_driver_versions_disallowed configuration: ' + cause).

Solutions

  1. Inspect the cause message appended after 'configuration: ' and address the underlying Jackson error
  2. Audit the classpath for conflicting jackson-databind versions and use the distribution's bundled libs
  3. Redeploy a clean Cassandra build so DEFAULT_CONFIG is pristine
  4. Report upstream if reproducible on an untouched distribution

Example fix

// before
Custom fork altered the versions map to a type Jackson cannot serialize
// after
Keep DEFAULT_CONFIG using standard Map<String, String> structures (or a Jackson-annotated type)
Defensive patterns

Strategy: try-catch

Validate before calling

String json = guardrails.getMinimumClientDriverVersionsDisallowed();
if (json == null || !json.startsWith("{")) logger.error("Unexpected serialization output");

Try / catch

try {
    String json = guardrails.getMinimumClientDriverVersionsDisallowed();
} catch (RuntimeException e) {
    logger.error("Failed to serialize minimum_client_driver_versions_disallowed: {}", e.getMessage());
    // audit Jackson classpath; redeploy clean build
}

Prevention

When it happens

Trigger: Calling getMinimumClientDriverVersionsDisallowed() when the default disallowed-versions structure cannot be JSON-serialized — typically due to a Jackson classpath conflict or a patched DEFAULT_CONFIG.

Common situations: Dependency-version drift in custom builds; monitoring/admin tooling reading guardrail config endpoints on a mis-built node; concurrent modification of the default config during serialization.

Understand the failure class

Background: "JSON serialization failed", "not JSON serializable", "Failed to serialize": why JSON marshaling errors happen and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/377681ad488d9547. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/guardrails/Guardrails.java:1943

        {
            return JsonUtils.JSON_OBJECT_MAPPER.writeValueAsString(DEFAULT_CONFIG.getMinimumClientDriverVersionsWarned());
        }
        catch (Throwable t)
        {
            throw new RuntimeException("Unable to serialize minimum_client_driver_versions_warned configuration: " + t.getMessage());
        }
    }

    @Override
    public String getMinimumClientDriverVersionsDisallowed()
    {
        try
        {
            return JsonUtils.JSON_OBJECT_MAPPER.writeValueAsString(DEFAULT_CONFIG.getMinimumClientDriverVersionsDisallowed());
        }
        catch (Throwable t)
        {
            throw new RuntimeException("Unable to serialize minimum_client_driver_versions_disallowed configuration: " + t.getMessage());
        }
    }

    @Override
    public void setMinimumClientDriverVersionsWarned(String value)
    {
        try
        {
            Map<String, String> map = JsonUtils.JSON_OBJECT_MAPPER.readValue(value, new TypeReference<>() {});
            GuardrailsOptions.validateAndSanitizeClientDriverVersions(map, "minimum_client_driver_versions_warned");
            DEFAULT_CONFIG.setMinimumClientDriverVersionsWarned(map);
        }
        catch (JsonProcessingException t)
        {
            throw new RuntimeException("Unable to deserialize payload for minimum_client_driver_versions_warned: " + t.getMessage());
        }
    }

View on GitHub (pinned to 88fd0f6a0e)