{"record":{"id":"bb5b681a351da397","repo":"apache/cassandra","slug":"no-configured-daemon","errorCode":null,"errorMessage":"No configured daemon","messagePattern":"No configured daemon","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":601,"sourceCode":"\n            Gossiper.instance.forceNewerGeneration();\n            Gossiper.instance.start((int) (currentTimeMillis() / 1000), true);\n        }\n    }\n\n    // should only be called via JMX\n    public boolean isGossipRunning()\n    {\n        return Gossiper.instance.isEnabled();\n    }\n\n    public synchronized void startNativeTransport()\n    {\n        checkServiceAllowedToStart(\"native transport\");\n\n        if (daemon == null)\n        {\n            throw new IllegalStateException(\"No configured daemon\");\n        }\n\n        try\n        {\n            daemon.startNativeTransport();\n        }\n        catch (Exception e)\n        {\n            throw new RuntimeException(\"Error starting native transport: \" + e.getMessage());\n        }\n    }\n\n    public void stopNativeTransport(boolean force)\n    {\n        if (daemon == null)\n        {\n            throw new IllegalStateException(\"No configured daemon\");\n        }","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L583-L619","documentation":"IllegalStateException from startNativeTransport: the StorageService daemon reference is null, i.e., CassandraServiceDaemon/CassandraDaemon was never wired into StorageService. Native transport cannot be started without a configured daemon.","triggerScenarios":"Calling startNativeTransport() via JMX or API before CassandraDaemon.init()/setup() completed and assigned the daemon, or in embedded/unit setups where no daemon was configured.","commonSituations":"JMX automation racing node startup (start native transport before the daemon finished initializing); embedded Cassandra usage that constructs StorageService without a daemon; calling start after a failed setup that left daemon null.","solutions":["Wait until the node finished startup (log line 'Startup complete' / StorageService.OperationMode NORMAL) before invoking startNativeTransport.","If embedded, ensure CassandraDaemon.getInstance().init()/start() has run so the daemon is set.","If daemon is null because startup failed, fix the underlying startup error first (check system.log) and restart the process."],"exampleFix":"// before\nstorageService.startNativeTransport(); // early JMX call\n// after\nif (!storageService.getOperationMode().equals(\"STARTING\") && storageService.isStarted()) {\n    storageService.startNativeTransport();\n}","handlingStrategy":"validation","validationCode":"String mode = (String) jmxConn.getAttribute(storageService, \"OperationMode\");\nboolean started = (boolean) jmxConn.getAttribute(storageService, \"Started\");\nif (!started || \"STARTING\".equals(mode)) waitUntilNodeReady();","typeGuard":"boolean canStartNativeTransport(StorageService ss) {\n    return ss.isStarted() && !\"STARTING\".equals(ss.getOperationMode());\n}","tryCatchPattern":"catch (IllegalStateException e) {\n    if (e.getMessage().equals(\"No configured daemon\")) {\n        waitForStartupCompletion();\n        storageService.startNativeTransport();\n        return;\n    }\n    throw e;\n}","preventionTips":["Only touch native-transport JMX operations after the node reports NORMAL/Started.","In embedded setups always init CassandraDaemon before StorageService calls.","Gate automation on startup health checks, not fixed sleeps.","Check system.log for failed setup when daemon stays null."],"tags":["cassandra","native-transport","startup","lifecycle","jmx"],"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"}