{"record":{"id":"a5a1dadd31d6b319","repo":"apache/cassandra","slug":"unsupported-message","errorCode":null,"errorMessage":"Unsupported message","messagePattern":"Unsupported message","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/messages/UnsupportedMessageCodec.java","lineNumber":45,"sourceCode":"\nimport io.netty.buffer.ByteBuf;\n\n/**\n * Catch-all codec for any unsupported legacy messages.\n */\npublic class UnsupportedMessageCodec <T extends Message> implements Message.Codec<T>\n{\n    public final static UnsupportedMessageCodec instance = new UnsupportedMessageCodec();\n\n    private static final Logger logger = LoggerFactory.getLogger(UnsupportedMessageCodec.class);\n\n    public T decode(ByteBuf body, ProtocolVersion version)\n    {\n        if (ProtocolVersion.SUPPORTED.contains(version))\n        {\n            logger.error(\"Received invalid message for supported protocol version {}\", version);\n        }\n        throw new ProtocolException(\"Unsupported message\");\n    }\n\n    public void encode(T t, ByteBuf dest, ProtocolVersion version)\n    {\n        throw new ProtocolException(\"Unsupported message\");\n    }\n\n    public int encodedSize(T t, ProtocolVersion version)\n    {\n        return 0;\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":58,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/messages/UnsupportedMessageCodec.java#L27-L58","documentation":"This codec is a placeholder for message types that have no wire representation (e.g. Options/Startup on some paths). Its decode method always throws a ProtocolException; if the protocol version is actually a supported one it first logs an error, indicating a corrupted/invalid frame routed the wrong message type rather than a legitimate unsupported version.","triggerScenarios":"A frame with a message opcode mapped to UnsupportedMessageCodec arrives on a connection using a supported protocol version — i.e. a malformed or out-of-order message type (e.g. a client sending an unexpected opcode where a decoded body is expected).","commonSituations":"Buggy or hand-rolled client implementations sending wrong opcodes; corrupted frames from a broken intermediary/proxy; protocol implementation bugs in drivers during version negotiation.","solutions":["Fix the client to send only valid opcodes for the negotiated protocol version","Check for proxies/load balancers corrupting the native protocol stream","Update the client driver to a supported release","Enable driver and server protocol logging to identify the offending opcode"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (io errors / ProtocolException) on the connection; log the opcode and negotiated version, then reconnect and renegotiate","preventionTips":["Use a maintained official Cassandra driver","Avoid custom proxies that reinterpret native protocol frames","Enable driver frame logging during protocol debugging"],"tags":["protocol","codec","invalid-frame","client-bug"],"backgroundTag":"unexpected-response-shape","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"}