{"record":{"id":"5fd7f790de10b321","repo":"apache/cassandra","slug":"unable-to-stop-gossip-because-the-node-is-not-in-t","errorCode":null,"errorMessage":"Unable to stop gossip because the node is not in the normal state. Try to stop the node instead.","messagePattern":"Unable to stop gossip because the node is not in the normal state\\. Try to stop the node instead\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":545,"sourceCode":"    }\n\n    public void register(IEndpointLifecycleSubscriber subscriber)\n    {\n        lifecycleSubscribers.add(subscriber);\n    }\n\n    public void unregister(IEndpointLifecycleSubscriber subscriber)\n    {\n        lifecycleSubscribers.remove(subscriber);\n    }\n\n    // should only be called via JMX\n    public void stopGossiping()\n    {\n        if (isGossipRunning())\n        {\n            if (!isNormal() && joinRing)\n                throw new IllegalStateException(\"Unable to stop gossip because the node is not in the normal state. Try to stop the node instead.\");\n\n            logger.warn(\"Stopping gossip by operator request\");\n\n            if (isNativeTransportRunning())\n            {\n                logger.warn(\"Disabling gossip while native transport is still active is unsafe\");\n            }\n\n            Gossiper.instance.stop();\n        }\n    }\n\n    // should only be called via JMX\n    public synchronized void startGossiping()\n    {\n        if (!isGossipRunning())\n        {\n            checkServiceAllowedToStart(\"gossip\");","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L527-L563","documentation":"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.","triggerScenarios":"Operator runs `nodetool disablegossip` while the node is still joining (bootstrap), leaving (decommission in progress), or moving, and joinRing=true.","commonSituations":"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.","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."],"exampleFix":"// before (JMX script)\nstorageService.stopGossiping();\n// after\nif (storageService.getOperationMode().equals(\"NORMAL\")) {\n    storageService.stopGossiping();\n} else {\n    // stop the whole node instead\n}","handlingStrategy":"validation","validationCode":"String mode = (String) jmxConn.getAttribute(storageService, \"OperationMode\");\nif (!\"NORMAL\".equals(mode)) throw new IllegalStateException(\"Cannot disable gossip while in \" + mode);","typeGuard":"boolean canStopGossip(StorageService ss) {\n    return ss.isGossipRunning() && \"NORMAL\".equals(ss.getOperationMode());\n}","tryCatchPattern":"catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"not in the normal state\")) {\n        waitForOperationMode(\"NORMAL\"); // or stop node fully instead\n        return;\n    }\n    throw e;\n}","preventionTips":["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."],"tags":["cassandra","gossip","jmx","node-state","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}