{"record":{"id":"06fb6a009da9298a","repo":"apache/cassandra","slug":"unhandled-status-byte-b","errorCode":null,"errorMessage":"Unhandled status byte: \" + b","messagePattern":"Unhandled status byte: \" \\+ b","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/topology/AccordFastPath.java","lineNumber":88,"sourceCode":"                switch (status)\n                {\n                    case NORMAL: out.write(0); break;\n                    case SHUTDOWN: out.write(1); break;\n                    case UNAVAILABLE: out.write(2); break;\n                    default: throw new IllegalStateException(\"Unhandled status: \" + this);\n                }\n            }\n\n            @Override\n            public Status deserialize(DataInputPlus in, Version version) throws IOException\n            {\n                byte b = in.readByte();\n                switch (b)\n                {\n                    case 0: return NORMAL;\n                    case 1: return SHUTDOWN;\n                    case 2: return UNAVAILABLE;\n                    default: throw new IllegalArgumentException(\"Unhandled status byte: \" + b);\n                }\n            }\n\n            @Override\n            public long serializedSize(Status status, Version version)\n            {\n                return TypeSizes.BYTE_SIZE;\n            }\n        };\n    };\n\n    public static class NodeInfo\n    {\n        public final Status status;\n        public final long updated;\n\n        public NodeInfo(Status status, long updated)\n        {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/topology/AccordFastPath.java#L70-L106","documentation":"Deserializes the AccordFastPath.Status one-byte enum. Bytes 0-2 map to NORMAL, SHUTDOWN, and UNAVAILABLE; anything else indicates a corrupted or future-version payload this build cannot interpret, so it throws IllegalArgumentException. This protects against silently accepting an unknown node status from the wire.","triggerScenarios":"AccordFastPath serializer deserialize() reads a status byte not in {0,1,2}, e.g. from a node running a newer build that added a status value.","commonSituations":"Rolling upgrades with an added Status constant; bit corruption or truncated buffers during message transport; hand-crafted test payloads using out-of-range bytes.","solutions":["Upgrade this node to match the peer's build so the new status byte is recognized.","Verify message framing/integrity if corruption is suspected.","Add the new status constant to this build's switch before rolling the newer nodes out."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check the byte before full deserialization if protocol allows peeking\nbyte b = peekStatusByte(buffer);\nif (b < 0 || b > 2) throw new IllegalArgumentException(\"Invalid AccordFastPath status byte: \" + b);","typeGuard":null,"tryCatchPattern":"try {\n    Status status = AccordFastPath.Status.serializer.deserialize(in, version);\n} catch (IllegalArgumentException e) {\n    logger.error(\"Unparseable fast-path status payload - possible version skew\", e);\n    metrics.corruptPayloads.inc();\n    requestResyncFromPeer();\n}","preventionTips":["Keep all nodes on the same build when Status constants change","Enable message checksumming/framing validation","Add new status values to older builds before rolling newer nodes"],"tags":["serialization","accord","enum"],"backgroundTag":"invalid-enum-value","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"}