{"record":{"id":"37d25055dcb32eb7","repo":"apache/cassandra","slug":"unable-to-find-sufficient-sources-for-streaming-ra-37d250","errorCode":null,"errorMessage":"Unable to find sufficient sources for streaming range  in keyspace ","messagePattern":"Unable to find sufficient sources for streaming range  in keyspace ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/dht/RangeStreamer.java","lineNumber":583,"sourceCode":"             if (!any(addressList, isSufficient))\n             {\n                 if (strat.getReplicationFactor().allReplicas == 1)\n                 {\n                     if (useStrictConsistency)\n                     {\n                         logger.warn(\"A node required to move the data consistently is down\");\n                         throw new IllegalStateException(\"Unable to find sufficient sources for streaming range \" + toFetch + \" in keyspace \" + keyspace + \" with RF=1. \" +\n                                                         \"Ensure this keyspace contains replicas in the source datacenter.\");\n                     }\n                     else\n                         logger.warn(\"Unable to find sufficient sources for streaming range {} in keyspace {} with RF=1. \" +\n                                     \"Keyspace might be missing data.\", toFetch, keyspace);\n                 }\n                 else\n                 {\n                     if (useStrictConsistency)\n                         logger.warn(\"A node required to move the data consistently is down\");\n                     throw new IllegalStateException(\"Unable to find sufficient sources for streaming range \" + toFetch + \" in keyspace \" + keyspace);\n                 }\n             }\n         }\n         return rangesToFetchWithPreferredEndpoints.build();\n     }\n\n    /**\n     * The preferred endpoint list is the wrong format because it is keyed by Replica (this node) rather than the source\n     * endpoint we will fetch from which streaming wants.\n     */\n    public static Multimap<InetAddressAndPort, FetchReplica> convertPreferredEndpointsToWorkMap(EndpointsByReplica preferredEndpoints)\n    {\n        Multimap<InetAddressAndPort, FetchReplica> workMap = HashMultimap.create();\n        for (Map.Entry<Replica, EndpointsForRange> e : preferredEndpoints.entrySet())\n        {\n            for (Replica source : e.getValue())\n            {\n                assert (e.getKey()).isSelf();","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/dht/RangeStreamer.java#L565-L601","documentation":"RangeStreamer throws this IllegalStateException when, while computing the ranges a node must fetch (e.g. during bootstrap or decommission), no live endpoint can serve a given range for a keyspace. It means the requested data would become unavailable if streaming proceeded, so Cassandra aborts rather than stream from nothing.","triggerScenarios":"Calling fetchMap/calculateRangesToFetchWithPreferredEndpoints when all replicas owning the range are down (or filtered out), typically during bootstrap/Range movement while strict consistency checks are in effect.","commonSituations":"Bootstrapping a node while an existing replica is down or still decommissioning; nodes with stale gossip; running repairs/moves concurrently with node replacement; disk-failure of the only source replica.","solutions":["Bring the replica node(s) owning the range back up and re-run bootstrap/streaming","Run nodetool repair / use repair or rebuild (nodetool rebuild -- <keyspace>) to obtain data from alternative sources","If consistency loss is acceptable, disable strict consistency (attribute useStrictConsistency=false path in older versions / -Dcassandra.consistent.rangemovement=false) and retry","Verify cluster topology and gossip status with nodetool status and nodetool netstats before retrying"],"exampleFix":"// before: bootstrap fails because source node is down\n// bin/cassandra (bootstrap) -> IllegalStateException: Unable to find sufficient sources...\n// after: restart source node and retry\nnodetool startbootstrap  # or restart the node\nnodetool status          # confirm all nodes Up/Normal first\nbin/nodetool rebuild -- keyspace1","handlingStrategy":"validation","validationCode":"// before bootstrap/streaming, verify all needed replicas are up\n// nodetool status -> every node Up/Normal\n// or programmatically: storageService.getNaturalEndpoints(keyspace, range) all reachable","typeGuard":null,"tryCatchPattern":"try {\n    streamer.fetch(map);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Unable to find sufficient sources\")) {\n        // alert operator; bring replica online or run nodetool rebuild\n    }\n}","preventionTips":["Verify nodetool status shows all nodes Up before topology changes","Avoid concurrent bootstrap/repair/decommission operations","Monitor node health; replace dead nodes promptly","Use nodetool rebuild for cases where strict consistency cannot be met"],"tags":["streaming","bootstrap","ring-movement"],"backgroundTag":"insufficient-replica-sources","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"}