apache/cassandra · error · MarshalException

Invalid remaining data after end of UDT value

Error message

Invalid remaining data after end of UDT value

What it means

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.

Solutions

  1. Align the written UDT value with the current type definition (remove stale trailing fields)
  2. Check for type-alter drift: fields added/removed after the value was written
  3. Rebuild the value with a driver using the current schema
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/serializers/UserTypeSerializer.java:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/f948262563b29300. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/serializers/UserTypeSerializer.java:74

            if (accessor.sizeFromOffset(input, offset) < size)
                throw new MarshalException(String.format("Not enough bytes to read %dth field %s", i, entry.getKey()));

            V field = accessor.slice(input, offset, size);
            try
            {
                offset += size;
                entry.getValue().validate(field, accessor);
            }
            catch (MarshalException e)
            {
                throw new MarshalException(String.format("Failure validating the %dth field %s; %s", i, entry.getKey(), e.getMessage()), e);
            }
        }

        // We're allowed to get less fields than declared, but not more
        if (!accessor.isEmptyFromOffset(input, offset))
            throw new MarshalException("Invalid remaining data after end of UDT value");
    }
}

View on GitHub (pinned to 88fd0f6a0e)