apache/cassandra · warning

[Stream {}] Error while reading partition {} from stream on

Error message

[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.

What it means

CassandraStreamReader.read() reads a (non-compressed-path) sstable stream from a peer and writes received partitions locally. On any Throwable during deserialization/writing it logs a warning with the plan ID, the partition key read so far, keyspace and table, aborts the partial StreamWriter to delete temp files, and rethrows so the StreamSession fails and can be retried.

Source

Thrown at src/java/org/apache/cassandra/db/streaming/CassandraStreamReader.java:158

            String sequenceName = writer.getFilename() + '-' + fileSeqNum;
            long lastBytesRead = 0;
            while (in.getBytesRead() < totalSize)
            {
                writePartition(deserializer, writer);
                // TODO move this to BytesReadTracker
                long bytesRead = in.getBytesRead();
                long bytesDelta = bytesRead - lastBytesRead;
                lastBytesRead = bytesRead;
                session.progress(sequenceName, ProgressInfo.Direction.IN, bytesRead, bytesDelta, totalSize);
            }
            logger.debug("[Stream #{}] Finished receiving file #{} from {} readBytes = {}, totalSize = {}",
                         session.planId(), fileSeqNum, session.peer, FBUtilities.prettyPrintMemory(in.getBytesRead()), FBUtilities.prettyPrintMemory(totalSize));
            return writer;
        }
        catch (Throwable e)
        {
            Object partitionKey = deserializer != null ? deserializer.partitionKey() : "";
            logger.warn("[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.",
                        session.planId(), partitionKey, cfs.getKeyspaceName(), cfs.getTableName(), e);
            if (writer != null)
                e = writer.abort(e);
            throw e;
        }
    }

    protected StreamDeserializer getDeserializer(TableMetadata metadata,
                                                 TrackedDataInputPlus in,
                                                 Version inputVersion,
                                                 StreamSession session,
                                                 SSTableMultiWriter writer) throws IOException
    {
        return new StreamDeserializer(metadata, in, inputVersion, getHeader(metadata), session, writer);
    }

    protected SerializationHeader getHeader(TableMetadata metadata) throws UnknownColumnException
    {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Retry the streaming operation (repair/bootstrap re-establishes the session) after checking network stability
  2. Inspect the full stack trace in the logs to identify root cause (corruption, disk, serialization)
  3. Check receiver disk space and permissions; free space if needed
  4. If corruption is suspected on the sender, run scrub on the source table and re-stream
Defensive patterns

Strategy: retry

Validate before calling

// pre-check receiver disk space and sender table health
// nodetool scrub <ks> <table> on sender if corruption suspected
// ensure adequate free space: df -h

Try / catch

try {
    reader.read(...);
} catch (Throwable t) {
    logger.warn("Streaming read of {} failed", fileSeqNum, t);
    // let StreamSession retry or rerun repair
}

Prevention

When it happens

Trigger: read() encounters a Throwable while reading partitions from the streaming input; common triggers are truncated connections, deserialization errors, or disk write failures mid-file.

Common situations: Flaky network or dropped peer connections during bootstrap/repair streaming; corrupt data on the sending node; disk full on the receiver; mixed-version streaming incompatibilities during upgrades.

Related errors


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