{"record":{"id":"31b1bf7b088840c7","repo":"apache/cassandra","slug":"no-in-progress-sequence-for","errorCode":null,"errorMessage":"No in progress sequence for ","messagePattern":"No in progress sequence for ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java","lineNumber":91,"sourceCode":"            if (sequence == null)\n                return metadata;\n            if (onlyStartupSafeSequences && !sequence.finishDuringStartup())\n                return metadata;\n            if (isLeave(sequence))\n                StorageService.instance.maybeInitializeServices();\n            if (resume(sequence))\n                metadata = ClusterMetadata.current();\n            else\n                return metadata;\n        }\n    }\n\n    public static boolean cancelInProgressSequences(String sequenceOwner, String expectedSequenceKind)\n    {\n        NodeId owner = NodeId.fromString(sequenceOwner);\n        MultiStepOperation<?> seq = ClusterMetadata.current().inProgressSequences.get(owner);\n        if (seq == null)\n            throw new IllegalArgumentException(\"No in progress sequence for \"+sequenceOwner);\n        MultiStepOperation.Kind expectedKind = MultiStepOperation.Kind.valueOf(expectedSequenceKind);\n        if (seq.kind() != expectedKind)\n            throw new IllegalArgumentException(\"No in progress sequence of kind \" + expectedKind + \" for \" + owner + \" (only \" + seq.kind() +\" in progress)\");\n\n        return StorageService.cancelInProgressSequences(owner);\n    }\n\n    @Override\n    public InProgressSequences withLastModified(Epoch epoch)\n    {\n        return new InProgressSequences(epoch, state);\n    }\n\n    @Override\n    public Epoch lastModified()\n    {\n        return lastModified;\n    }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java#L73-L109","documentation":"cancelInProgressSequences looks up an in-progress MultiStepOperation for the given NodeId in the current ClusterMetadata. If no sequence is registered for that node it throws IllegalArgumentException, because there is nothing to cancel. This guards nodetool-driven cancellation against stale or wrong node identifiers.","triggerScenarios":"Calling StorageService/InProgressSequences.cancelInProgressSequences(owner, kind) with a node id that has no entry in ClusterMetadata.current().inProgressSequences, e.g. after the sequence already completed, failed, or a wrong NodeId string was passed.","commonSituations":"Operator tries to cancel a bootstrap/replace that already finished; typo in the node id passed to nodetool; attempt to cancel on a node that never started a sequence; retrying a cancel that already succeeded.","solutions":["Verify the exact node id with nodetool status / cluster metadata before cancelling","Check whether the sequence already completed or failed; a completed sequence cannot be cancelled","Re-run the cancellation only if the sequence is genuinely listed as in progress","If the sequence is stuck but not visible in inProgressSequences, investigate TCM metadata state rather than retrying cancel"],"exampleFix":"// before\ninProgressSequences.cancelInProgressSequences(nodeId, kind); // may throw if none\n// after\nif (ClusterMetadata.current().inProgressSequences.get(NodeId.fromString(nodeId)) != null)\n    inProgressSequences.cancelInProgressSequences(nodeId, kind);\nelse\n    logger.info(\"No in-progress sequence for {}, nothing to cancel\", nodeId);","handlingStrategy":"type-guard","validationCode":"NodeId owner = NodeId.fromString(sequenceOwner);\nif (ClusterMetadata.current().inProgressSequences.get(owner) == null)\n    return false; // nothing to cancel","typeGuard":"boolean hasInProgressSequence(String nodeId) {\n    return ClusterMetadata.current().inProgressSequences.get(NodeId.fromString(nodeId)) != null;\n}","tryCatchPattern":"try { cancelInProgressSequences(owner, kind); } catch (IllegalArgumentException e) { logger.info(\"Nothing to cancel for {}: {}\", owner, e.getMessage()); }","preventionTips":["Look up the node id from nodetool status before issuing cancel","Treat 'already finished' cancels as no-ops in automation","Make cancel flows idempotent"],"tags":["illegal-argument","not-found","cluster-metadata","sequence"],"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-17T15:17:12.973Z"}