{"record":{"id":"bc5a8736cad5d234","repo":"apache/cassandra","slug":"sequence-of-kind-kind-is-in-progress-for-node","errorCode":null,"errorMessage":"Sequence of kind ${kind} is in progress for node ${nodeIpOrId}. Cannot proceed with this operation.","messagePattern":"Sequence of kind (.+?) is in progress for node (.+?)\\. Cannot proceed with this operation\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/CMSOfflineTool.java","lineNumber":264,"sourceCode":"            return metadata;\n        }\n\n        @Override\n        protected void execute(Output output) throws IOException\n        {\n            ClusterMetadata metadata = parseClusterMetadata();\n            NodeId nodeId = nodeIdentifierOption.getNodeId(metadata);\n\n            MultiStepOperation<?> multiStepOperation = metadata.inProgressSequences.get(nodeId);\n            if (multiStepOperation == null)\n            {\n                throw new IllegalArgumentException(\"No transformation sequence is in progress for \" +\n                                                   nodeIdentifierOption.getNodeIpOrId() + '.');\n            }\n\n            if (!supportedKinds().contains(multiStepOperation.kind()))\n            {\n                throw new IllegalArgumentException(\"Sequence of kind \" + multiStepOperation.kind() +\n                                                   \" is in progress for node \" + nodeIdentifierOption.getNodeIpOrId() +\n                                                   \". Cannot proceed with this operation.\");\n            }\n\n            CancelInProgressSequence cancelSequence = new CancelInProgressSequence(nodeId);\n            ClusterMetadata updatedMetadata = cancelSequence.execute(metadata).success().metadata;\n            updatedMetadata = postCancel(updatedMetadata, nodeId);\n            writeMetadata(output, updatedMetadata, outputFilePath);\n        }\n    }\n\n    /**\n     * Cancels a JOIN or REPLACE bootstrap sequence for the given node and unregisters it\n     * from the cluster. Use this when a node is stuck in bootstrapping or replacement.\n     * Fails if no in-progress sequence exists, or if the sequence is not of kind JOIN or REPLACE.\n     */\n    @Command(name = \"abortbootstrap\",\n    description = \"Aborts bootstrap for given node if in progress.\")","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/CMSOfflineTool.java#L246-L282","documentation":"CMSOfflineTool aborts an in-progress multi-step operation (e.g. JOIN/REPLACE/MOVE) against a node, but only for sequence kinds it supports cancelling. If ClusterMetadata shows a sequence of an unsupported kind in progress for the target node, it throws this IllegalArgumentException because an offline cancel of that kind is not implemented.","triggerScenarios":"Running a CMSOfflineTool abort/cancel operation via `execute` when metadata.inProgressSequences contains an entry for the node whose kind() is not in supportedKinds() (checked after fetching the in-progress MultiStepOperation).","commonSituations":"Operator runs the offline tool while the node has a non-cancellable sequence (e.g. a bootstrap or relocation kind not on the supported list); stale ClusterMetadata snapshot taken from the offline metadata file still references an old sequence.","solutions":["Check the in-progress sequence kind with a live nodetool/cms command instead of the offline tool, and complete or abort it through the supported online path.","Complete the sequence on the live cluster (e.g. finish the bootstrap/move) before running the offline tool.","Hand-edit or regenerate the cluster metadata so no unsupported sequence is registered for the node (only in a controlled recovery scenario)."],"exampleFix":"// before\nthrow new IllegalArgumentException(\"Sequence of kind \" + multiStepOperation.kind() + \" is in progress for node \" + nodeIdentifierOption.getNodeIpOrId() + \". Cannot proceed with this operation.\");\n// after\n// no code fix; operator must clear the sequence via the supported online path first","handlingStrategy":"validation","validationCode":"ClusterMetadata meta = /* loaded metadata */;\nNodeId nodeId = /* resolved node */;\nMultiStepOperation<?> op = meta.inProgressSequences.get(nodeId);\nif (op != null && !SUPPORTED_CANCEL_KINDS.contains(op.kind()))\n    throw new IllegalStateException(\"Unsupported in-progress sequence \" + op.kind() + \" for \" + nodeId + \"; clear it online first\");","typeGuard":null,"tryCatchPattern":"try { tool.abort(nodeId); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Sequence of kind\")) { /* complete/cancel sequence online, then retry */ } else throw e; }","preventionTips":["Check in-progress sequences for the node before running offline abort.","Keep offline metadata snapshots fresh; stale snapshots hide sequence state changes.","Prefer online nodetool/cms flows to clear sequences before offline recovery."],"tags":["cluster-metadata","sequence-in-progress","cms","offline-tool"],"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-17T15:17:12.973Z"}