{"record":{"id":"f948262563b29300","repo":"apache/cassandra","slug":"invalid-remaining-data-after-end-of-udt-value","errorCode":null,"errorMessage":"Invalid remaining data after end of UDT value","messagePattern":"Invalid remaining data after end of UDT value","errorType":"validation","errorClass":"MarshalException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/serializers/UserTypeSerializer.java","lineNumber":74,"sourceCode":"\n            if (accessor.sizeFromOffset(input, offset) < size)\n                throw new MarshalException(String.format(\"Not enough bytes to read %dth field %s\", i, entry.getKey()));\n\n            V field = accessor.slice(input, offset, size);\n            try\n            {\n                offset += size;\n                entry.getValue().validate(field, accessor);\n            }\n            catch (MarshalException e)\n            {\n                throw new MarshalException(String.format(\"Failure validating the %dth field %s; %s\", i, entry.getKey(), e.getMessage()), e);\n            }\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 UDT value\");\n    }\n}\n","sourceCodeStart":56,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/serializers/UserTypeSerializer.java#L56-L77","documentation":"MarshalException from UserTypeSerializer.validate after all declared UDT fields are consumed: bytes still remain in the buffer. Like tuples, UDTs allow fewer fields than declared (field addition) but trailing unaccounted bytes indicate a serialization that does not match the current user type.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/serializers/UserTypeSerializer.java:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align the written UDT value with the current type definition (remove stale trailing fields)","Check for type-alter drift: fields added/removed after the value was written","Rebuild the value with a driver using the current schema"],"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"}