{"record":{"id":"9e3fbaa82ea48da1","repo":"apache/cassandra","slug":"another-sequence-of-kind-kind-is-in-progress-fo","errorCode":null,"errorMessage":"Another sequence of kind ${kind} is in progress for node ${nodeIpOrId}. Cannot proceed with move.","messagePattern":"Another sequence of kind (.+?) is in progress for node (.+?)\\. Cannot proceed with move\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/CMSOfflineTool.java","lineNumber":516,"sourceCode":"                throw new IllegalArgumentException(\"Target token \" + toToken + \" is already owned by node \" + tokenOwnerId.id());\n            }\n            if (metadata.tokenMap.tokens(nodeId).size() > 1)\n            {\n                throw new UnsupportedOperationException(\"This node has more than one token and cannot be moved thusly.\");\n            }\n\n            PrepareMove prepareMove = new PrepareMove(nodeId, Set.of(toToken), new UniformRangePlacement(), false);\n            ClusterMetadata updatedMetadata = prepareMove.execute(metadata).success().metadata;\n            updatedMetadata = updatedMetadata.inProgressSequences.get(nodeId).applyTo(updatedMetadata).success().metadata;\n            writeMetadata(output, updatedMetadata, outputFilePath);\n        }\n\n        ClusterMetadata finishInProgressSequence(NodeId nodeId, String token, ClusterMetadata metadata)\n        {\n            MultiStepOperation<?> multiStepOperation = metadata.inProgressSequences.get(nodeId);\n            if (multiStepOperation.kind() != MultiStepOperation.Kind.MOVE)\n            {\n                throw new IllegalArgumentException(\"Another sequence of kind \" + multiStepOperation.kind() +\n                                                   \" is in progress for node \" + nodeIdentifierOption.getNodeIpOrId() +\n                                                   \". Cannot proceed with move.\");\n            }\n\n            Move moveInProgress = (Move) multiStepOperation;\n            Collection<Token> inProgressTokens = moveInProgress.tokens;\n            Collection<Token> givenTokenSet;\n            if (token == null)\n            {\n                givenTokenSet = Set.of();\n            }\n            else\n            {\n                metadata.partitioner.getTokenFactory().validate(token);\n                givenTokenSet = Set.of(metadata.partitioner.getTokenFactory().fromString(token));\n            }\n            if (givenTokenSet.isEmpty() || new HashSet<>(moveInProgress.tokens).equals(givenTokenSet))\n            {","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/CMSOfflineTool.java#L498-L534","documentation":"finishInProgressSequence resumes an existing MOVE sequence, so it requires that the node's in-progress sequence actually be a MOVE. If inProgressSequences.get(nodeId).kind() is anything else, this IllegalArgumentException is thrown to prevent mixing a token argument with a different operation.","triggerScenarios":"Calling finishInProgressSequence (reached via updatedMetadata) when the node has an in-progress sequence of a non-MOVE kind (JOIN, REPLACE, REBUILD, etc.) while running the move command.","commonSituations":"Operator confuses an in-progress bootstrap with a move and passes --token; leftover non-MOVE sequence in the metadata snapshot makes the tool think it should resume a move.","solutions":["Run the subcommand matching the in-progress sequence kind (e.g. resume/abort the JOIN or REPLACE) instead of move.","Finish or cancel the other sequence first, then start a fresh MOVE with a --token.","Verify the node's in-progress sequence kind from the metadata before invoking move."],"exampleFix":"// before\nbin/cms move -ip 10.0.0.5 --token 1234   // JOIN in progress\n// after\nbin/cms <join-resume-or-abort> -ip 10.0.0.5\nbin/cms move -ip 10.0.0.5 --token 1234","handlingStrategy":"validation","validationCode":"MultiStepOperation<?> op = meta.inProgressSequences.get(nodeId);\nif (op != null && op.kind() != MultiStepOperation.Kind.MOVE)\n    throw new IllegalStateException(\"Sequence \" + op.kind() + \" in progress; move cannot resume it\");","typeGuard":null,"tryCatchPattern":"try { tool.move(nodeId, token); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Cannot proceed with move\")) { runMatchingSequenceCommand(); } else throw e; }","preventionTips":["Match the subcommand to the node's actual in-progress sequence kind.","List in-progress sequences before resuming any multi-step operation.","Clear unrelated sequences (JOIN/REPLACE) before starting moves."],"tags":["sequence-in-progress","wrong-operation","move","cms"],"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"}