apache/cassandra · error · IllegalStateException

Unable to find sufficient sources for streaming range in ke

Error message

Unable to find sufficient sources for streaming range  in keyspace 

What it means

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.

Source

Thrown at src/java/org/apache/cassandra/dht/RangeStreamer.java:583

             if (!any(addressList, isSufficient))
             {
                 if (strat.getReplicationFactor().allReplicas == 1)
                 {
                     if (useStrictConsistency)
                     {
                         logger.warn("A node required to move the data consistently is down");
                         throw new IllegalStateException("Unable to find sufficient sources for streaming range " + toFetch + " in keyspace " + keyspace + " with RF=1. " +
                                                         "Ensure this keyspace contains replicas in the source datacenter.");
                     }
                     else
                         logger.warn("Unable to find sufficient sources for streaming range {} in keyspace {} with RF=1. " +
                                     "Keyspace might be missing data.", toFetch, keyspace);
                 }
                 else
                 {
                     if (useStrictConsistency)
                         logger.warn("A node required to move the data consistently is down");
                     throw new IllegalStateException("Unable to find sufficient sources for streaming range " + toFetch + " in keyspace " + keyspace);
                 }
             }
         }
         return rangesToFetchWithPreferredEndpoints.build();
     }

    /**
     * The preferred endpoint list is the wrong format because it is keyed by Replica (this node) rather than the source
     * endpoint we will fetch from which streaming wants.
     */
    public static Multimap<InetAddressAndPort, FetchReplica> convertPreferredEndpointsToWorkMap(EndpointsByReplica preferredEndpoints)
    {
        Multimap<InetAddressAndPort, FetchReplica> workMap = HashMultimap.create();
        for (Map.Entry<Replica, EndpointsForRange> e : preferredEndpoints.entrySet())
        {
            for (Replica source : e.getValue())
            {
                assert (e.getKey()).isSelf();

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Bring the replica node(s) owning the range back up and re-run bootstrap/streaming
  2. Run nodetool repair / use repair or rebuild (nodetool rebuild -- <keyspace>) to obtain data from alternative sources
  3. If consistency loss is acceptable, disable strict consistency (attribute useStrictConsistency=false path in older versions / -Dcassandra.consistent.rangemovement=false) and retry
  4. Verify cluster topology and gossip status with nodetool status and nodetool netstats before retrying

Example fix

// before: bootstrap fails because source node is down
// bin/cassandra (bootstrap) -> IllegalStateException: Unable to find sufficient sources...
// after: restart source node and retry
nodetool startbootstrap  # or restart the node
nodetool status          # confirm all nodes Up/Normal first
bin/nodetool rebuild -- keyspace1
Defensive patterns

Strategy: validation

Validate before calling

// before bootstrap/streaming, verify all needed replicas are up
// nodetool status -> every node Up/Normal
// or programmatically: storageService.getNaturalEndpoints(keyspace, range) all reachable

Try / catch

try {
    streamer.fetch(map);
} catch (IllegalStateException e) {
    if (e.getMessage().contains("Unable to find sufficient sources")) {
        // alert operator; bring replica online or run nodetool rebuild
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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