{"record":{"id":"7e5410a5fb9b008a","repo":"apache/cassandra","slug":"stream-error-while-reading-partition-from-7e5410","errorCode":null,"errorMessage":"[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.","messagePattern":"\\[Stream (.+?)\\] Error while reading partition (.+?) from stream on ks='(.+?)' and table='(.+?)'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/streaming/CassandraStreamReader.java","lineNumber":158,"sourceCode":"            String sequenceName = writer.getFilename() + '-' + fileSeqNum;\n            long lastBytesRead = 0;\n            while (in.getBytesRead() < totalSize)\n            {\n                writePartition(deserializer, writer);\n                // TODO move this to BytesReadTracker\n                long bytesRead = in.getBytesRead();\n                long bytesDelta = bytesRead - lastBytesRead;\n                lastBytesRead = bytesRead;\n                session.progress(sequenceName, ProgressInfo.Direction.IN, bytesRead, bytesDelta, totalSize);\n            }\n            logger.debug(\"[Stream #{}] Finished receiving file #{} from {} readBytes = {}, totalSize = {}\",\n                         session.planId(), fileSeqNum, session.peer, FBUtilities.prettyPrintMemory(in.getBytesRead()), FBUtilities.prettyPrintMemory(totalSize));\n            return writer;\n        }\n        catch (Throwable e)\n        {\n            Object partitionKey = deserializer != null ? deserializer.partitionKey() : \"\";\n            logger.warn(\"[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.\",\n                        session.planId(), partitionKey, cfs.getKeyspaceName(), cfs.getTableName(), e);\n            if (writer != null)\n                e = writer.abort(e);\n            throw e;\n        }\n    }\n\n    protected StreamDeserializer getDeserializer(TableMetadata metadata,\n                                                 TrackedDataInputPlus in,\n                                                 Version inputVersion,\n                                                 StreamSession session,\n                                                 SSTableMultiWriter writer) throws IOException\n    {\n        return new StreamDeserializer(metadata, in, inputVersion, getHeader(metadata), session, writer);\n    }\n\n    protected SerializationHeader getHeader(TableMetadata metadata) throws UnknownColumnException\n    {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/streaming/CassandraStreamReader.java#L140-L176","documentation":"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.","triggerScenarios":"read() encounters a Throwable while reading partitions from the streaming input; common triggers are truncated connections, deserialization errors, or disk write failures mid-file.","commonSituations":"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.","solutions":["Retry the streaming operation (repair/bootstrap re-establishes the session) after checking network stability","Inspect the full stack trace in the logs to identify root cause (corruption, disk, serialization)","Check receiver disk space and permissions; free space if needed","If corruption is suspected on the sender, run scrub on the source table and re-stream"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check receiver disk space and sender table health\n// nodetool scrub <ks> <table> on sender if corruption suspected\n// ensure adequate free space: df -h","typeGuard":null,"tryCatchPattern":"try {\n    reader.read(...);\n} catch (Throwable t) {\n    logger.warn(\"Streaming read of {} failed\", fileSeqNum, t);\n    // let StreamSession retry or rerun repair\n}","preventionTips":["Run scrub on source tables before large re-streams if corruption is suspected","Maintain free disk headroom on receiving nodes","Avoid streaming across mixed incompatible versions","Monitor logs during bootstrap/repair for early failure detection"],"tags":["streaming","network","serialization","io"],"backgroundTag":"stream-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}