{"record":{"id":"377681ad488d9547","repo":"apache/cassandra","slug":"unable-to-serialize-minimum-client-driver-versions-377681","errorCode":null,"errorMessage":"Unable to serialize minimum_client_driver_versions_disallowed configuration: ","messagePattern":"Unable to serialize minimum_client_driver_versions_disallowed configuration: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/guardrails/Guardrails.java","lineNumber":1943,"sourceCode":"        {\n            return JsonUtils.JSON_OBJECT_MAPPER.writeValueAsString(DEFAULT_CONFIG.getMinimumClientDriverVersionsWarned());\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(\"Unable to serialize minimum_client_driver_versions_warned configuration: \" + t.getMessage());\n        }\n    }\n\n    @Override\n    public String getMinimumClientDriverVersionsDisallowed()\n    {\n        try\n        {\n            return JsonUtils.JSON_OBJECT_MAPPER.writeValueAsString(DEFAULT_CONFIG.getMinimumClientDriverVersionsDisallowed());\n        }\n        catch (Throwable t)\n        {\n            throw new RuntimeException(\"Unable to serialize minimum_client_driver_versions_disallowed configuration: \" + t.getMessage());\n        }\n    }\n\n    @Override\n    public void setMinimumClientDriverVersionsWarned(String value)\n    {\n        try\n        {\n            Map<String, String> map = JsonUtils.JSON_OBJECT_MAPPER.readValue(value, new TypeReference<>() {});\n            GuardrailsOptions.validateAndSanitizeClientDriverVersions(map, \"minimum_client_driver_versions_warned\");\n            DEFAULT_CONFIG.setMinimumClientDriverVersionsWarned(map);\n        }\n        catch (JsonProcessingException t)\n        {\n            throw new RuntimeException(\"Unable to deserialize payload for minimum_client_driver_versions_warned: \" + t.getMessage());\n        }\n    }\n","sourceCodeStart":1925,"sourceCodeEnd":1961,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/guardrails/Guardrails.java#L1925-L1961","documentation":"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).","triggerScenarios":"Calling getMinimumClientDriverVersionsDisallowed() when the default disallowed-versions structure cannot be JSON-serialized — typically due to a Jackson classpath conflict or a patched DEFAULT_CONFIG.","commonSituations":"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.","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"],"exampleFix":"// before\nCustom fork altered the versions map to a type Jackson cannot serialize\n// after\nKeep DEFAULT_CONFIG using standard Map<String, String> structures (or a Jackson-annotated type)","handlingStrategy":"try-catch","validationCode":"String json = guardrails.getMinimumClientDriverVersionsDisallowed();\nif (json == null || !json.startsWith(\"{\")) logger.error(\"Unexpected serialization output\");","typeGuard":null,"tryCatchPattern":"try {\n    String json = guardrails.getMinimumClientDriverVersionsDisallowed();\n} catch (RuntimeException e) {\n    logger.error(\"Failed to serialize minimum_client_driver_versions_disallowed: {}\", e.getMessage());\n    // audit Jackson classpath; redeploy clean build\n}","preventionTips":["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"],"tags":["guardrails","json-serialization","client-driver-versions"],"backgroundTag":"json-serialization-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}