{"record":{"id":"0f80ea0188ca0a0f","repo":"apache/cassandra","slug":"node-is-not-in-gossip-not-running-gossiptask","errorCode":null,"errorMessage":"Node {} is not in gossip, not running GossipTask","messagePattern":"Node (.+?) is not in gossip, not running GossipTask","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/gms/Gossiper.java","lineNumber":275,"sourceCode":"\n    public Map<InetAddressAndPort, EndpointState> getEndpointStates()\n    {\n        return endpointStateMap;\n    }\n\n    private class GossipTask implements Runnable\n    {\n        public void run()\n        {\n            try\n            {\n                taskLock.lock();\n\n                /* Update the local heartbeat counter. */\n                EndpointState epstate = endpointStateMap.get(getBroadcastAddressAndPort());\n                if (epstate == null)\n                {\n                    logger.warn(\"Node {} is not in gossip, not running GossipTask\", getBroadcastAddressAndPort());\n                    return;\n                }\n                epstate.updateHeartBeat();\n                if (logger.isTraceEnabled())\n                    logger.trace(\"My heartbeat is now {}\", endpointStateMap.get(FBUtilities.getBroadcastAddressAndPort()).getHeartBeatState().getHeartBeatVersion());\n                final List<GossipDigest> gDigests = new ArrayList<>();\n\n                Gossiper.instance.makeGossipDigest(gDigests);\n\n                if (gDigests.size() > 0)\n                {\n                    GossipDigestSyn digestSynMessage = new GossipDigestSyn(getClusterName(),\n                                                                           getPartitionerName(),\n                                                                           ClusterMetadata.current().metadataIdentifier,\n                                                                           gDigests);\n                    Message<GossipDigestSyn> message = Message.out(GOSSIP_DIGEST_SYN, digestSynMessage);\n                    /* Gossip to some random live member */\n                    EnumSet<GossipedWith> gossipedWith = doGossipToLiveMember(message);","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/gms/Gossiper.java#L257-L293","documentation":"A logger.warn (not an exception): Gossiper's GossipTask.run() checks that the local node's own EndpointState exists in endpointStateMap before each gossip round; if absent, it warns and returns without gossiping. Normally the node seeds its own state at startup; a missing entry means gossip was not fully initialized (e.g., during shutdown, or startGossiping was invoked without proper local state setup).","triggerScenarios":"The periodic gossip loop runs while endpointStateMap.get(getBroadcastAddressAndPort()) is null — typically when the node is shutting down (gossip state removed) but the scheduled task still fires, or when gossip internals were manipulated (startGossiping/stopGossiping, shadow round) without re-seeding local state.","commonSituations":"Node shutdown or `nodetool gossipoff`/drain racing the gossip timer; test harnesses restarting gossip without reinitializing; broadcast address changing (IP change) so the expected key is no longer in the map; scripted `nodetool disablegossip` + enable sequences hitting a race.","solutions":["If seen during shutdown, it is benign — ignore; the task exits as the node stops.","If seen while running: restart Cassandra so local gossip state is fully re-initialized.","Check that broadcast_address/broadcast_rpc_address settings are stable and not changed between restarts.","Re-enable gossip properly (`nodetool enablegossip`) and confirm with `nodetool status` that the node sees its own state."],"exampleFix":"// before: scripted toggle causing race\nnodetool disablegossip && nodetool enablegossip  // task may fire with no local state\n// after: allow orderly re-init\nnodetool disablegossip; sleep 5; nodetool enablegossip; nodetool status  # verify own node is UP","handlingStrategy":"validation","validationCode":"// before scripted gossip toggles, ensure gossip is stable\nnodetool status | grep -q \"$(hostname -i)\" || { echo 'local endpoint missing from gossip'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the warning during shutdown/drain as benign.","Avoid rapid disablegossip/enablegossip cycles in scripts.","Keep broadcast address configuration stable across restarts.","If persistent while running, restart the node to re-seed local gossip state."],"tags":["gossip","startup","lifecycle"],"backgroundTag":"gossip-state-not-initialized","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}