apache/cassandra · error · MarshalException
'null' deserialized value for %s with %s
Error message
'null' deserialized value for %s with %s
What it means
NonTokenizingAnalyzer.hasNext deserializes the indexed term via indexTermType.asString(input). If the deserialized string is null for a non-null input byte buffer, the analyzer treats it as an internal marshalling inconsistency and throws MarshalException reporting the hex bytes and the term type. This indicates the term bytes do not match the expected type encoding.
Source
Thrown at src/java/org/apache/cassandra/index/sai/analyzer/NonTokenizingAnalyzer.java:78
this.filterPipeline = getFilterPipeline();
}
@Override
public boolean hasNext()
{
// check that we know how to handle the input, otherwise bail
if (!indexTermType.isString())
return false;
if (hasNext)
{
try
{
String input = indexTermType.asString(this.input);
if (input == null)
{
throw new MarshalException(String.format("'null' deserialized value for %s with %s",
ByteBufferUtil.bytesToHex(this.input), indexTermType));
}
String result = FilterPipelineExecutor.execute(filterPipeline, input);
if (result == null)
{
nextLiteral = null;
next = null;
return false;
}
nextLiteral = result;
next = indexTermType.fromString(result);
return true;
}
catch (MarshalException e)View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Rebuild the affected SAI index (DROP and re-CREATE) so all terms are re-encoded with the current type.
- Verify the column type has not changed since the index was created; if it has, recreate the index.
- Run repairs/scrub and check for corrupted SSTables or index files.
- If reproducible after rebuild, capture the type/hex in the message and file a Cassandra bug with the version.
Defensive patterns
Strategy: try-catch
Try / catch
catch (MarshalException e) { if (e.getMessage().startsWith("'null' deserialized value")) { // rebuild the SAI index for this table; do not retry the same operation blindly } else throw e; } Prevention
- Rebuild SAI indexes after altering column types
- Keep index files and schema versions in sync across upgrades
- Treat MarshalException on index paths as corruption: scrub/repair and rebuild
When it happens
Trigger: Indexing/querying where the term ByteBuffer for the index term type cannot be deserialized to a String (null result) — typically corrupt or type-mismatched term bytes fed into the analyzer during index build or query validation.
Common situations: Schema/type changes under an existing SAI index (column type altered without rebuilding the index); reading SSTables/index files written by an incompatible version; internal corruption.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- CQL type
- ComponentMetadata not found
- Error initializing OnDiskOrdinalsMap at segment
- Corrupt flags value for clustering prefix (isStatic flag set
- Invalid Columns subset bytes; too many bits set:<encoded>
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/194408e92b7bf5a5.
Report an issue: GitHub.