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
- Inspect the cause message appended after 'configuration: ' and address the underlying Jackson error
- Audit the classpath for conflicting jackson-databind versions and use the distribution's bundled libs
- Redeploy a clean Cassandra build so DEFAULT_CONFIG is pristine
- 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
- Keep DEFAULT_CONFIG structures Jackson-friendly (plain maps/POJOs)
- Run a smoke test reading guardrail getters after every custom build
- Preserve the cause message (appended here) in your own wrappers to ease debugging
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
- Unable to serialize minimum_client_driver_versions_warned…
- Unable to serialize password_policy configuration
- Unable to serialize role_name_policy configuration
- Batch too large
- Cannot alter gc_grace_seconds of a materialized view to 0…
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)