{"record":{"id":"07da0a1b8f6f13b9","repo":"apache/cassandra","slug":"no-serializer-exists-for-kind-kind","errorCode":null,"errorMessage":"No serializer exists for kind {kind}","messagePattern":"No serializer exists for kind (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java","lineNumber":156,"sourceCode":"                case IS_NOT_NULL:\n                case IS_NULL:\n                    return Exists.serializer;\n                case EQUAL:\n                case NOT_EQUAL:\n                case LESS_THAN:\n                case LESS_THAN_OR_EQUAL:\n                case GREATER_THAN:\n                case GREATER_THAN_OR_EQUAL:\n                    return Value.serializer;\n                case AND:\n                case OR:\n                    return BooleanGroup.serializer;\n                case NONE:\n                    return None.serializer;\n                case COLUMN_CONDITIONS:\n                    return ColumnConditionsAdapter.serializer;\n                default:\n                    throw new IllegalArgumentException(\"No serializer exists for kind \" + this);\n            }\n        }\n    }\n\n    protected final Kind kind;\n\n    public TxnCondition(Kind kind)\n    {\n        this.kind = kind;\n    }\n\n    @Override\n    public boolean equals(Object o)\n    {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n        TxnCondition condition = (TxnCondition) o;\n        return kind == condition.kind;","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java#L138-L174","documentation":"Each TxnCondition.Kind has an associated serializer; the Kind.serializer() switch returns it for known kinds and throws IllegalArgumentException for any other value, including future or corrupted kinds. Since Kind is an enum this normally signals deserialization of an unknown kind byte or code compiled against mismatched enum definitions.","triggerScenarios":"Calling Kind.serializer() on a Kind value not covered by the switch (any kind beyond the enumerated KNOWN/BOOLEAN_GROUP/NONE/COLUMN_CONDITIONS cases in this build).","commonSituations":"Wire payload produced by a newer build with an added TxnCondition.Kind; enum desynchronized between nodes during rolling upgrade; corrupted serialized transaction conditions.","solutions":["Align all nodes to the same build so the kind is defined on both ends.","Inspect the kind value in the message to identify which newer constant is being sent.","Add a serializer case for the new Kind in this build before accepting traffic from upgraded peers."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify the kind is known to this build before decoding\nint kindOrdinal = readKindOrdinal(payload);\nif (kindOrdinal < 0 || kindOrdinal >= TxnCondition.Kind.values().length)\n    throw new IllegalArgumentException(\"Unknown TxnCondition kind: \" + kindOrdinal);","typeGuard":null,"tryCatchPattern":"try {\n    ITxnConditionSerializer s = kind.serializer();\n} catch (IllegalArgumentException e) {\n    logger.error(\"Unknown TxnCondition kind from peer - build mismatch?\", e);\n    rejectMessage(peer); // do not partially deserialize\n}","preventionTips":["Keep cluster builds homogeneous when adding enum constants","Reject unknown kinds early instead of partial deserialization","Add new kinds to all nodes before sending them"],"tags":["accord","serialization","transactions"],"backgroundTag":"unsupported-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}