{"record":{"id":"100b10705208c96f","repo":"apache/cassandra","slug":"invalid-remaining-data-after-end-of-tuple-value","errorCode":null,"errorMessage":"Invalid remaining data after end of tuple value","messagePattern":"Invalid remaining data after end of tuple value","errorType":"validation","errorClass":"MarshalException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/serializers/TupleSerializer.java","lineNumber":63,"sourceCode":"\n            int size = accessor.getInt(input, offset);\n            offset += TypeSizes.INT_SIZE;\n\n            // size < 0 means null value\n            if (size < 0)\n                continue;\n\n            if (accessor.sizeFromOffset(input, offset) < size)\n                throw new MarshalException(String.format(\"Not enough bytes to read %dth component\", i));\n\n            V field = accessor.slice(input, offset, size);\n            offset += size;\n            fields.get(i).validate(field, accessor);\n        }\n\n        // We're allowed to get less fields than declared, but not more\n        if (!accessor.isEmptyFromOffset(input, offset))\n            throw new MarshalException(\"Invalid remaining data after end of tuple value\");\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/serializers/TupleSerializer.java#L45-L66","documentation":"MarshalException from TupleSerializer.validate after all declared fields have been consumed: bytes still remain in the buffer. Tuples allow fewer components than declared (field addition), but trailing unaccounted bytes indicate an invalid or stale serialization that does not match the current tuple type.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/serializers/TupleSerializer.java:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align the written tuple with the current type definition (drop extra trailing components)","Check for schema/type drift between the writer and the current tuple type","Validate input client-side before sending"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}