{"record":{"id":"92973634be0e87db","repo":"apache/cassandra","slug":"the-specified-range-s-is-not-a-range-that-is-owne","errorCode":null,"errorMessage":"The specified range %s is not a range that is owned by this node. Please ensure that all token ranges specified to be rebuilt belong to this node.","messagePattern":"The specified range (.+?) is not a range that is owned by this node\\. Please ensure that all token ranges specified to be rebuilt belong to this node\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/Rebuild.java","lineNumber":226,"sourceCode":"\n        // Ensure all specified ranges are actually ranges owned by this host\n        RangesAtEndpoint localReplicas = StorageService.instance.getLocalReplicas(keyspace);\n        RangesAtEndpoint.Builder streamRanges = new RangesAtEndpoint.Builder(getBroadcastAddressAndPort(), ranges.size());\n        for (Range<Token> specifiedRange : ranges)\n        {\n            boolean foundParentRange = false;\n            for (Replica localReplica : localReplicas)\n            {\n                if (localReplica.contains(specifiedRange))\n                {\n                    streamRanges.add(localReplica.decorateSubrange(specifiedRange));\n                    foundParentRange = true;\n                    break;\n                }\n            }\n            if (!foundParentRange)\n            {\n                throw new IllegalArgumentException(String.format(\"The specified range %s is not a range that is owned by this node. Please ensure that all token ranges specified to be rebuilt belong to this node.\", specifiedRange.toString()));\n            }\n        }\n        return streamRanges.build();\n    }\n\n    private static MovementMap movementMap(ClusterMetadata metadata, String keyspace, String tokens)\n    {\n        MovementMap.Builder movementMapBuilder = MovementMap.builder();\n        if (keyspace == null)\n        {\n            metadata.placements().forEach((params, placement) -> movementMapBuilder.put(params, addMovementsForParams(placement, null)));\n            // Special case to include the system metadata keyspace\n            ReplicationParams metaParams = Keyspace.open(METADATA_KEYSPACE_NAME).getMetadata().params.replication;\n            movementMapBuilder.put(metaParams, addMovementsForParams(metadata.placement(metaParams), null));\n        }\n        else if (tokens == null)\n        {\n            ReplicationParams params = Keyspace.open(keyspace).getMetadata().params.replication;","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/Rebuild.java#L208-L244","documentation":"Each user-specified token range must be contained within a range this node currently owns (its local replicas); ranges not owned by the node are rejected because the node cannot stream ranges it does not hold.","triggerScenarios":"rebuild with tokens containing a range outside the node's current ownership for the given keyspace — e.g. after ring changes, wrong keyspace RF/replication, or ranges belonging to another node.","commonSituations":"Token ranges captured before topology changes; specifying ranges of a different node; keyspace with different replication strategy than expected; rebuild on a node that just bootstrapped and owns fewer ranges.","solutions":["Verify current ownership with `nodetool ring` / `nodetool describering <keyspace>` and pass only ranges the node owns","Omit the tokens argument to rebuild all locally owned ranges","Recompute ranges after any pending topology operations (bootstrap/decommission) settle"],"exampleFix":"// before (range not owned)\nnodetool rebuild -ks ks1 --tokens \"(0,100]\"\n// after (query ownership first, then use owned range)\nnodetool describering ks1\nnodetool rebuild -ks ks1 --tokens \"(-9223372036854775808,-4611686018427387904]\"","handlingStrategy":"validation","validationCode":"RangesAtEndpoint owned = StorageService.instance.getLocalReplicas(keyspace);\nfor (Range<Token> r : requested)\n    if (owned.simpleRanges().noneMatch(o -> o.range().contains(r)))\n        throw new IllegalArgumentException(\"range not owned: \" + r);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive ranges from `nodetool describering <keyspace>` at rebuild time, not from stale notes","Recheck ownership after any bootstrap/decommission/move","If unsure, rebuild without --tokens to stream all locally owned ranges"],"tags":["tokens","ownership","validation","rebuild"],"backgroundTag":"invalid-argument-value","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"}