apache/cassandra · error · IllegalStateException
Unable to stop gossip because the node is not in the normal
Error message
Unable to stop gossip because the node is not in the normal state. Try to stop the node instead.
What it means
IllegalStateException from stopGossiping (JMX entry point): gossip can only be stopped while the node is in NORMAL state when joinRing is true. Stopping gossip on a joining/leaving/moving node would strand ring operations, so Cassandra refuses and suggests stopping the whole node.
Source
Thrown at src/java/org/apache/cassandra/service/StorageService.java:545
}
public void register(IEndpointLifecycleSubscriber subscriber)
{
lifecycleSubscribers.add(subscriber);
}
public void unregister(IEndpointLifecycleSubscriber subscriber)
{
lifecycleSubscribers.remove(subscriber);
}
// should only be called via JMX
public void stopGossiping()
{
if (isGossipRunning())
{
if (!isNormal() && joinRing)
throw new IllegalStateException("Unable to stop gossip because the node is not in the normal state. Try to stop the node instead.");
logger.warn("Stopping gossip by operator request");
if (isNativeTransportRunning())
{
logger.warn("Disabling gossip while native transport is still active is unsafe");
}
Gossiper.instance.stop();
}
}
// should only be called via JMX
public synchronized void startGossiping()
{
if (!isGossipRunning())
{
checkServiceAllowedToStart("gossip");View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Wait for the in-progress operation (join/leave/move) to finish, then disable gossip.
- If the operation is stuck, complete or cancel it (`nodetool decommission` failure handling) before disabling gossip.
- Instead stop the entire node (`nodetool stop` / service stop) if the goal is to take it fully offline.
- If joinRing=false (non-ring node), the check does not apply — verify the node's joining configuration.
Example fix
// before (JMX script)
storageService.stopGossiping();
// after
if (storageService.getOperationMode().equals("NORMAL")) {
storageService.stopGossiping();
} else {
// stop the whole node instead
} Defensive patterns
Strategy: validation
Validate before calling
String mode = (String) jmxConn.getAttribute(storageService, "OperationMode");
if (!"NORMAL".equals(mode)) throw new IllegalStateException("Cannot disable gossip while in " + mode); Type guard
boolean canStopGossip(StorageService ss) {
return ss.isGossipRunning() && "NORMAL".equals(ss.getOperationMode());
} Try / catch
catch (IllegalStateException e) {
if (e.getMessage().contains("not in the normal state")) {
waitForOperationMode("NORMAL"); // or stop node fully instead
return;
}
throw e;
} Prevention
- Check OperationMode via JMX before disablegossip in automation.
- Never disable gossip during bootstrap/decommission; finish or cancel the operation first.
- Use full node stop when the goal is taking the node offline.
- Gate operational runbooks on the 'Startup complete' log marker.
When it happens
Trigger: Operator runs `nodetool disablegossip` while the node is still joining (bootstrap), leaving (decommission in progress), or moving, and joinRing=true.
Common situations: Incident response disabling gossip mid-bootstrap; automation that blindly runs disablegossip during a rolling operation; decommission hung and operator tried to stop gossip to 'reset' the node.
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
- %s is not a valid JMX resource name
- JAAS login configuration missing for JMX authenticator setup
- Authentication error
- Unrecognized Callback:
- MBeanServer already initialized
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/5fd7f790de10b321.
Report an issue: GitHub.