{"record":{"id":"c60593aa9bcbc7af","repo":"apache/cassandra","slug":"can-t-abort-bootstrap-for-node-since-the-state-is","errorCode":null,"errorMessage":"Can't abort bootstrap for node  since the state is ","messagePattern":"Can't abort bootstrap for node  since the state is ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":1690,"sourceCode":"        if (Gossiper.instance.isKnownEndpoint(endpoint) && FailureDetector.instance.isAlive(endpoint))\n            throw new RuntimeException(\"Can't abort bootstrap for \" + nodeId + \" - it is alive\");\n        NodeState nodeState = metadata.directory.peerState(nodeId);\n        switch (nodeState)\n        {\n            case REGISTERED:\n            case BOOTSTRAPPING:\n            case BOOT_REPLACING:\n                if (metadata.inProgressSequences.contains(nodeId))\n                {\n                    MultiStepOperation<?> seq = metadata.inProgressSequences.get(nodeId);\n                    if (seq.kind() != MultiStepOperation.Kind.JOIN && seq.kind() != MultiStepOperation.Kind.REPLACE)\n                        throw new RuntimeException(\"Can't abort bootstrap for \" + nodeId + \" since it is not bootstrapping\");\n                    ClusterMetadataService.instance().commit(new CancelInProgressSequence(nodeId));\n                }\n                ClusterMetadataService.instance().commit(new Unregister(nodeId, EnumSet.of(REGISTERED, BOOTSTRAPPING, BOOT_REPLACING), ClusterMetadataService.instance().placementProvider()));\n                break;\n            default:\n                throw new RuntimeException(\"Can't abort bootstrap for node \" + nodeId + \" since the state is \" + nodeState);\n        }\n    }\n\n    private static NodeId parseNodeIdOrEndpoint(ClusterMetadata metadata, String nodeStr, String endpointStr)\n    {\n        NodeId nodeId;\n        if (!StringUtils.isEmpty(nodeStr))\n        {\n            try\n            {\n                nodeId = NodeId.fromString(nodeStr);\n            }\n            catch (IllegalArgumentException | UnsupportedOperationException e)\n            {\n                String msg = \"Unable to parse node id string \" + nodeStr;\n                logger.warn(\"{}\", msg, e);\n                throw new IllegalArgumentException(msg, e);\n            }","sourceCodeStart":1672,"sourceCodeEnd":1708,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L1672-L1708","documentation":"Thrown by StorageService.abortBootstrap when the node's peer state is not one of REGISTERED, BOOTSTRAPPING, or BOOT_REPLACING - the only states from which a bootstrap can be aborted. The node is for example NORMAL (a full member), LEFT, or in some other lifecycle state, so aborting a bootstrap makes no sense.","triggerScenarios":"Running `nodetool abortbootstrap <node>` for a node that already completed its join (state NORMAL), was decommissioned, or never was bootstrapping; specifying the wrong node id/address.","commonSituations":"Operator aborts against the wrong node (typo or picked the wrong host id); trying to remove a fully-joined node (should use decommission instead); retrying abort after bootstrap already succeeded.","solutions":["Check the node state with `nodetool gossipinfo` or cluster metadata - if it is NORMAL, the bootstrap finished and no abort is needed","If you want to remove a joined node, use `nodetool decommission` (on the node) or the appropriate removenode/assassinate flow instead","Verify the NodeId/host id - you may be targeting a different node than intended","If the node is stuck in an unexpected state, consult the state value in the message and follow the matching lifecycle operation"],"exampleFix":"// before\nnodetool abortbootstrap <id-of-NORMAL-node>\n// after\nnodetool status          # confirm state\n# node already joined:\nnodetool decommission    # on the node to remove\n# or for a dead member: nodetool removenode <host-id>","handlingStrategy":"validation","validationCode":"// Only call abortbootstrap for nodes in REGISTERED/BOOTSTRAPPING/BOOT_REPLACING state\n// Check `nodetool gossipinfo` / status first; if state is NORMAL use decommission instead.","typeGuard":null,"tryCatchPattern":"try {\n    probe.abortBootstrap(nodeId);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"since the state is\"))\n        log.warn(\"Node not bootstrapping; pick the lifecycle op matching its state (decommission/removenode)\");\n    else throw e;\n}","preventionTips":["Check node state with `nodetool status`/gossipinfo before aborting","Use decommission for joined nodes and removenode for dead members, not abortbootstrap","Verify the host id targets the node you intend"],"tags":["nodetool","bootstrap","node-state","node-lifecycle"],"backgroundTag":"invalid-state-transition","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"}