{"record":{"id":"3074dc8e1948b1d9","repo":"apache/cassandra","slug":"e-getmessage-invalidrequestexception-wrapping-m","errorCode":null,"errorMessage":"e.getMessage() (InvalidRequestException wrapping MarshalException)","messagePattern":"e\\.getMessage\\(\\) \\(InvalidRequestException wrapping MarshalException\\)","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/terms/Marker.java","lineNumber":121,"sourceCode":"        {\n            ByteBuffer bytes = context.options().getValue(bindIndex);\n            if (bytes == null)\n                return null;\n\n            if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)\n                return ByteBufferUtil.UNSET_BYTE_BUFFER;\n\n            if (receiver.type instanceof MultiElementType<?>)\n            {\n                return MultiElements.Value.fromSerialized(bytes, (MultiElementType<?>) receiver.type).get();\n            }\n\n            receiver.type.validate(bytes);\n            return bytes;\n        }\n        catch (MarshalException e)\n        {\n            throw new InvalidRequestException(e.getMessage(), e);\n        }\n    }\n\n    public boolean isByteArrayGetSupported(FunctionContext context)\n    {\n        return context.options().isByteArrayValuesGetSupported();\n    }\n\n    /*\n       Same logic as bind() but it returns byte[] instead of ByteBuffer and there is no Value wrapper usage\n     */\n    @Override\n    public byte[] bindAndGetByteArray(FunctionContext context) throws InvalidRequestException\n    {\n        try\n        {\n            byte[] bytes = context.options().getByteArrayValues()[bindIndex];\n            if (bytes == null)","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/terms/Marker.java#L103-L139","documentation":"In Marker.bindAndGet, a bound-variable payload failed receiver.type.validate with a MarshalException; the code rethrows it as an InvalidRequestException carrying e.getMessage(). Indicates the serialized bytes for the bind marker are not decodable as the receiver column's type during statement execution.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/cql3/terms/Marker.java:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a bound value whose serialized bytes validate against the column's type","Verify client-side serialization matches the schema type (int vs varint, timestamp format, etc.)"],"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"}