apache/cassandra · error · IllegalStateException

Can't force remove completion, abort the remove operation…

Error message

Can't force remove completion, abort the remove operation and retry.

What it means

forceRemoveCompletion is a last-resort hook that only works while a removal operation is in progress; in this code path it unconditionally throws IllegalStateException because no removal operation is active, telling the operator to abort and retry the remove instead.

Solutions

  1. Run `nodetool removenode <hostId>` first (without force) on the removal coordinator
  2. If a previous remove already finished, no force is needed — verify with nodetool netstats/ gossip
  3. If removeNode fails, abort and re-run the removal rather than forcing

Example fix

// before
nodetool removenode force
// after
nodetool removenode <host_id>   # standard removal; force only if removal is genuinely stuck in progress
Defensive patterns

Strategy: validation

Validate before calling

// only call forceRemoveCompletion if a removal is actually in progress
if (!removalInProgress())
    throw new IllegalStateException("No remove operation in progress");

Try / catch

try { ss.forceRemoveCompletion(); } catch (IllegalStateException e) { /* no active removal: run normal removenode */ }

Prevention

When it happens

Trigger: Calling `nodetool removenode force` (StorageServiceMBean.forceRemoveCompletion) when removeNode was never called on this node, the previous removal already completed, or the removal state was cleared after restart.

Common situations: Operators habitually appending 'force' to removenode; attempting to force-complete after the node was restarted (removal state lost); forcing removal on the wrong node (the one being removed rather than the coordinator).

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/2c30431f3a6c7252. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/StorageService.java:3704

                {
                    sb.append("Removing node ").append(nodeId.toUUID()).append(" (").append(metadata.directory.endpoint(nodeId)).append(')').append(": ").append(seq.status());
                    found = true;
                }
            }
        }
        if (!found)
            sb.append("No removals in progress.");
        return sb.toString();
    }

    /**
     * Force a remove operation to complete. This may be necessary if a remove operation
     * blocks forever due to node/stream failure. removeNode() must be called
     * first, this is a last resort measure.  No further attempt will be made to restore replicas.
     */
    public void forceRemoveCompletion()
    {
        throw new IllegalStateException("Can't force remove completion, abort the remove operation and retry.");
    }

    /**
     * Remove a node that has died, attempting to restore the replica count.
     * If the node is alive, decommission should be attempted.  If decommission
     * fails, then removeNode should be called.  If we fail while trying to
     * restore the replica count, finally forceRemoveCompleteion should be
     * called to forcibly remove the node without regard to replica count.
     *
     * @param hostIdString Host ID for the node
     */
    public void removeNode(String hostIdString)
    {
        removeNode(hostIdString, false);
    }

    public void removeNode(String hostIdString, boolean force)
    {

View on GitHub (pinned to 88fd0f6a0e)