apache/cassandra · error · IllegalArgumentException

Move in progress for another token(s)

Error message

Move in progress for another token(s) ${inProgressTokens}.

What it means

When resuming a MOVE, the --token argument must match the token(s) of the MOVE already in progress. If the given token set is non-empty and differs from moveInProgress.tokens, the tool throws this IllegalArgumentException listing the tokens the ongoing move actually targets.

Solutions

  1. Re-run without --token so the tool resumes the in-progress MOVE with its own tokens.
  2. Supply the exact token(s) reported in this error message (inProgressTokens).
  3. Inspect the in-progress MOVE sequence state to see its tokens before retrying.

Example fix

// before
bin/cms move -ip 10.0.0.5 --token 1111   // move in progress for [2222]
// after
bin/cms move -ip 10.0.0.5 --token 2222   // matches in-progress move
Defensive patterns

Strategy: validation

Validate before calling

MultiStepOperation<?> op = meta.inProgressSequences.get(nodeId);
if (op instanceof Move && token != null && !((Move) op).tokens.equals(Set.of(parsedToken)))
    throw new IllegalArgumentException("Token mismatch; move in progress for " + ((Move) op).tokens);

Try / catch

try { tool.move(nodeId, token); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Move in progress for another token")) { resumeWithoutTokenOrUseListedTokens(); } else throw e; }

Prevention

When it happens

Trigger: finishInProgressSequence (via updatedMetadata) with a non-empty givenTokenSet that is not equal to new HashSet<>(moveInProgress.tokens).

Common situations: Operator forgot which token the interrupted move targeted and supplies a different one; copy-paste of a token from another node or an old command line.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/CMSOfflineTool.java:538

            Move moveInProgress = (Move) multiStepOperation;
            Collection<Token> inProgressTokens = moveInProgress.tokens;
            Collection<Token> givenTokenSet;
            if (token == null)
            {
                givenTokenSet = Set.of();
            }
            else
            {
                metadata.partitioner.getTokenFactory().validate(token);
                givenTokenSet = Set.of(metadata.partitioner.getTokenFactory().fromString(token));
            }
            if (givenTokenSet.isEmpty() || new HashSet<>(moveInProgress.tokens).equals(givenTokenSet))
            {
                return moveInProgress.applyTo(metadata).success().metadata;
            }

            throw new IllegalArgumentException("Move in progress for another token(s) " + inProgressTokens + '.');
        }
    }

    /**
     * Identifies a target node using either its IP address or its integer/UUID node ID.
     * Exactly one of {@code -ip} or {@code -id} must be provided.
     */
    static class NodeIdentifierOption
    {
        @Option(names = { "-ip", "--ip-address" }, required = true,
        description = "IP address of the target endpoint. Port can be optionally specified " +
                      "using a colon after the IP address (e.g., 127.0.0.1:9042).")
        private String ip;

        @Option(names = { "-id", "--node-id" }, required = true,
        description = "Node ID. It can be integer ID assigned to node or the node uuid.")
        private String id;

View on GitHub (pinned to 88fd0f6a0e)