apache/cassandra · error · java.lang.IllegalStateException

This cluster is migrating to cluster metadata, can't abort %

Error message

This cluster is migrating to cluster metadata, can't abort %s until that is done.

What it means

abortHelper (used by abortDecommission, abortRemoveNode, abortMove) refuses to abort any multi-step operation while the cluster is migrating to Cluster Metadata (isMigrating() or state GOSSIP), throwing IllegalStateException with the operation kind in the message. Aborting topology sequences mid-migration could leave metadata inconsistent.

Source

Thrown at src/java/org/apache/cassandra/tcm/sequences/SingleNodeSequences.java:254

        StorageService.instance.clearTransientMode();
        InProgressSequences.finishInProgressSequences(self);
    }

    static void abortMove(String nodeId)
    {
        abortHelper(nodeId, MultiStepOperation.Kind.MOVE, MOVE_FAILED);
    }

    /**
     *
     * @param nodeId node id to abort the MSO for, null for local node
     * @param kind the expected kind of the multi step operation to abort
     * @param ssMode the legacy mode we want storage service to be in, null for any
     */
    private static void abortHelper(@Nullable String nodeId, MultiStepOperation.Kind kind, @Nullable StorageService.Mode ssMode)
    {
        if (ClusterMetadataService.instance().isMigrating() || ClusterMetadataService.state() == ClusterMetadataService.State.GOSSIP)
            throw new IllegalStateException(String.format("This cluster is migrating to cluster metadata, can't abort %s until that is done.", kind));

        ClusterMetadata metadata = ClusterMetadata.current();
        NodeId toAbort = nodeId == null ? metadata.myNodeId() : NodeId.fromString(nodeId);
        MultiStepOperation<?> sequence = metadata.inProgressSequences.get(toAbort);
        if (sequence == null || sequence.kind() != kind)
        {
            if (toAbort.equals(metadata.myNodeId()) && ssMode != null && StorageService.instance.operationMode() == ssMode)
            {
                // there is no ongoing sequence with the given kind, but storage service operation mode is set, clear it
                logger.debug("There is no ongoing {} sequence for this node, but operation mode is {} - clearing transient mode", kind, ssMode);
                StorageService.instance.clearTransientMode();
                return;
            }
            else
            {
                String msg = String.format("No %s operation in progress for %s, can't abort (%s)", kind, toAbort, sequence);
                logger.info(msg);
                throw new IllegalStateException(msg);

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Wait for the TCM migration to complete, then run the abort command again.
  2. Find nodes still in GOSSIP/migration state via logs and complete their migration first.
  3. If migration itself is blocked by the stuck operation, resolve the migration blocker per upgrade documentation instead of aborting.
Defensive patterns

Strategy: validation

Validate before calling

if (ClusterMetadataService.instance().isMigrating() || ClusterMetadataService.state() == ClusterMetadataService.State.GOSSIP)
    return; // defer abort until migration completes

Try / catch

try { abortMove(nodeId); }
catch (IllegalStateException e) { if (e.getMessage().contains("migrating")) { scheduleRetryAfterMigration(); } else throw e; }

Prevention

When it happens

Trigger: Running `nodetool abortmove` / `abortdecommission` / `abortremovenode` while ClusterMetadataService.instance().isMigrating() is true or ClusterMetadataService.state() == State.GOSSIP.

Common situations: Trying to clean up a stuck topology operation during a rolling upgrade to TCM before migration finishes; abort scripts executed as part of an upgrade runbook too early.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/bb6022f7012c8c65. Report an issue: GitHub.