{"record":{"id":"45d22a45e729c8a0","repo":"apache/cassandra","slug":"can-t-abort-bootstrap-for-it-does-not-exist-in","errorCode":null,"errorMessage":"Can't abort bootstrap for  - it does not exist in cluster metadata","messagePattern":"Can't abort bootstrap for  - it does not exist in cluster metadata","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":1671,"sourceCode":"            logger.info(\"Resuming bootstrap...\");\n            resumeBootstrapSequence();\n            return true;\n        }\n        else\n        {\n            logger.info(\"Resuming bootstrap is requested, but the node is already bootstrapped.\");\n            return false;\n        }\n    }\n\n    public void abortBootstrap(String nodeStr, String endpointStr)\n    {\n        logger.info(\"Aborting bootstrap for {}\", StringUtils.isEmpty(nodeStr) ? endpointStr : nodeStr);\n        ClusterMetadata metadata = ClusterMetadata.current();\n        NodeId nodeId = parseNodeIdOrEndpoint(metadata, nodeStr, endpointStr);\n        InetAddressAndPort endpoint = metadata.directory.endpoint(nodeId);\n        if (endpoint == null)\n            throw new IllegalArgumentException(\"Can't abort bootstrap for \" + nodeId + \" - it does not exist in cluster metadata\");\n        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:","sourceCodeStart":1653,"sourceCodeEnd":1689,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L1653-L1689","documentation":"Thrown by StorageService.abortBootstrap when the given node id resolves to a node that is absent from cluster metadata (the directory has no endpoint for it). Abort bootstrap only works for nodes the cluster knows about (registered, bootstrapping, or replaced nodes); a completely unknown id cannot be unregistered. It is raised as IllegalArgumentException to signal invalid operator input to nodetool.","triggerScenarios":"Calling `nodetool abortbootstrap <nodeId|ip>` (or JMX StorageServiceMBean.abortBootstrap) with a NodeId that was never registered, an id from a wiped/rebuilt cluster, or an id whose directory entry was already removed by a prior abort.","commonSituations":"Operator typo in the node id; aborting a bootstrap that was already aborted (directory entry removed); running against the wrong cluster whose metadata never contained the node; cluster metadata reset after a full cluster rebuild.","solutions":["Verify the node id with `nodetool status` or by querying cluster metadata (System.ClusterMetadata / metadata directory) and re-run with the correct id","Check whether the bootstrap was already aborted - the Unregister commit removes the directory entry, so a second abort fails this way; nothing more to do","Confirm you are connected to the intended cluster (correct contact point/JMX host)","If the node is mid-join, use its current id as reported by the joining node's logs"],"exampleFix":"// before\nnodetool abortbootstrap 3f2a...  // stale id\n// after\nnodetool status            # find the correct NodeId/host id\nnodetool abortbootstrap <current-host-id>","handlingStrategy":"validation","validationCode":"// Before calling abortbootstrap, verify the id exists in cluster metadata\nString hostId = /* from nodetool status output */;\nif (hostId == null || hostId.isEmpty())\n    throw new IllegalStateException(\"Supply the node's host id from `nodetool status`\");","typeGuard":null,"tryCatchPattern":"try {\n    probe.abortBootstrap(nodeId);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"does not exist in cluster metadata\"))\n        log.warn(\"Node {} unknown; refresh id via nodetool status\", nodeId);\n    else throw e;\n}","preventionTips":["Always source node ids from `nodetool status` host id column, not from memory","Remember abortbootstrap removes the directory entry - it is not idempotent/retryable","Confirm the target cluster before running destructive nodetool operations"],"tags":["nodetool","cluster-metadata","bootstrap","invalid-argument"],"backgroundTag":"resource-not-found","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"}