{"record":{"id":"63bbaab86791cb19","repo":"apache/cassandra","slug":"can-not-initialize-cms-without-any-seeds","errorCode":null,"errorMessage":"Can not initialize CMS without any seeds","messagePattern":"Can not initialize CMS without any seeds","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/tcm/Startup.java","lineNumber":801,"sourceCode":"        /**\n         * Node is starting for the first time, and is a designated first CMS node and can become a first CMS\n         * node upon boot.\n         */\n        FIRST_CMS,\n        /**\n         * Node has to pick Cluster Metadata from the specified file. Used for testing and for (improbable) disaster recovery.\n         */\n        BOOT_WITH_CLUSTERMETADATA;\n\n        static StartupMode get(Set<InetAddressAndPort> seeds)\n        {\n            if (CassandraRelevantProperties.TCM_UNSAFE_BOOT_WITH_CLUSTERMETADATA.isPresent())\n            {\n                logger.warn(\"Booting with ClusterMetadata from file: \" + CassandraRelevantProperties.TCM_UNSAFE_BOOT_WITH_CLUSTERMETADATA.getString());\n                return BOOT_WITH_CLUSTERMETADATA;\n            }\n            if (seeds.isEmpty())\n                throw new IllegalArgumentException(\"Can not initialize CMS without any seeds\");\n            boolean hasAnyEpoch = SystemKeyspaceStorage.hasAnyEpoch();\n\n            // For CCM and local dev clusters\n            boolean isOnlySeed = DatabaseDescriptor.getSeeds().size() == 1\n                                 && DatabaseDescriptor.getSeeds().contains(FBUtilities.getBroadcastAddressAndPort())\n                                 && DatabaseDescriptor.getSeeds().iterator().next().getAddress().isLoopbackAddress();\n            boolean hasBootedBefore = SystemKeyspace.getLocalHostId() != null;\n            logger.info(\"hasAnyEpoch = {}, hasBootedBefore = {}\", hasAnyEpoch, hasBootedBefore);\n            if (!hasAnyEpoch && hasBootedBefore &&\n                // Atomic long processor currently does not support upgrades\n                !CassandraRelevantProperties.TCM_USE_ATOMIC_LONG_PROCESSOR.getBoolean())\n                return UPGRADE;\n            else if (hasAnyEpoch)\n                return NORMAL;\n            else if (isOnlySeed)\n                return FIRST_CMS;\n            else\n                return VOTE;","sourceCodeStart":783,"sourceCodeEnd":819,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/Startup.java#L783-L819","documentation":"During CMS (Cluster Metadata Service) initialization mode selection, a node booting without existing ClusterMetadata must have seed endpoints configured; if the seed list is empty and no unsafe boot-with-clustermetadata override is set, it throws IllegalArgumentException because there is no way to discover or seed cluster metadata.","triggerScenarios":"Startup with empty cassandra.seed_provider seeds list on a node that must select a CMS discovery mode (no boot-with-clustermetadata property present).","commonSituations":"Fresh install where seeds were never set in cassandra.yaml; templating/config-management rendered an empty seeds value; copying a config that expects env-var substitution that didn't happen.","solutions":["Set cassandra.seed_provider class_name SimpleSeedProvider and seeds list in cassandra.yaml to at least one running node","For dev/CCM-only, optionally set TCM_UNSAFE_BOOT_WITH_CLUSTERMETADATA to boot with metadata from file (unsafe, dev only)","Restart the node after fixing seeds","Validate the effective config (system log prints seeds at startup) to confirm the list is populated"],"exampleFix":"// before (cassandra.yaml)\nseed_provider:\n  - class_name: SimpleSeedProvider\n    seeds: []\n// after\nseed_provider:\n  - class_name: SimpleSeedProvider\n    seeds: [\"10.0.0.1:7000\"]","handlingStrategy":"validation","validationCode":"if (DatabaseDescriptor.getSeeds().isEmpty())\n    throw new IllegalArgumentException(\"cassandra.seed_provider seeds must be non-empty\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure at least one seed in cassandra.yaml before first start","Verify config-templating actually rendered the seeds value (grep the deployed yaml)","Use the unsafe clustermetadata boot property only for local dev, never production"],"tags":["tcm","seeds","configuration","startup"],"backgroundTag":"missing-required-config-field","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"}