{"record":{"id":"577497669d7324a1","repo":"apache/cassandra","slug":"saved-cluster-name-savedclustername-configure","errorCode":null,"errorMessage":"Saved cluster name <savedClusterName> != configured name <configuredClusterName>","messagePattern":"Saved cluster name <savedClusterName> != configured name <configuredClusterName>","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/db/SystemKeyspace.java","lineNumber":1232,"sourceCode":"        }\n        ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(LOCAL);\n\n        String req = \"SELECT cluster_name FROM system.%s WHERE key='%s'\";\n        UntypedResultSet result = executeInternal(format(req, LOCAL, LOCAL));\n\n        if (result.isEmpty() || !result.one().has(\"cluster_name\"))\n        {\n            // this is a brand new node\n            if (!cfs.getLiveSSTables().isEmpty())\n                throw new ConfigurationException(\"Found system keyspace files, but they couldn't be loaded!\");\n\n            // no system files.  this is a new node.\n            return;\n        }\n\n        String savedClusterName = result.one().getString(\"cluster_name\");\n        if (!DatabaseDescriptor.getClusterName().equals(savedClusterName))\n            throw new ConfigurationException(\"Saved cluster name \" + savedClusterName + \" != configured name \" + DatabaseDescriptor.getClusterName());\n    }\n\n    public static Collection<Token> getSavedTokens()\n    {\n        String req = \"SELECT tokens FROM system.%s WHERE key='%s'\";\n        UntypedResultSet result = executeInternal(format(req, LOCAL, LOCAL));\n        return result.isEmpty() || !result.one().has(\"tokens\")\n             ? Collections.<Token>emptyList()\n             : deserializeTokens(result.one().getSet(\"tokens\", UTF8Type.instance));\n    }\n\n    public static int incrementAndGetGeneration()\n    {\n        String req = \"SELECT gossip_generation FROM system.%s WHERE key='%s'\";\n        UntypedResultSet result = executeInternal(format(req, LOCAL, LOCAL));\n\n        int generation;\n        if (result.isEmpty() || !result.one().has(\"gossip_generation\"))","sourceCodeStart":1214,"sourceCodeEnd":1250,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/SystemKeyspace.java#L1214-L1250","documentation":"checkHealth compares the cluster_name persisted in system.local with the cluster_name configured in cassandra.yaml. Any mismatch throws ConfigurationException, because a node joining with the wrong cluster name would corrupt cluster membership and gossip. This is an intentional safety check at startup.","triggerScenarios":"Starting a node whose system.local row stores a saved cluster name different from DatabaseDescriptor.getClusterName(), typically after editing cluster_name in cassandra.yaml on an existing node, or pointing the data directory at data from another cluster.","commonSituations":"Renaming a cluster by editing yaml instead of doing a clean re-bootstrap; copying data directories between clusters/environments (staging vs prod); misconfigured dc rollout reusing another cluster's data disk.","solutions":["Restore cassandra.yaml cluster_name to the saved value shown in the error message and restart","If renaming is truly intended, wipe the data directory and re-bootstrap the node into the new cluster","Verify data_dir points to this cluster's data, not a copied directory from another environment","Check the saved name with cqlsh: SELECT cluster_name FROM system.local;"],"exampleFix":"// before (cassandra.yaml)\ncluster_name: 'Prod Cluster'\n// after (match saved name)\ncluster_name: 'Staging Cluster'","handlingStrategy":"validation","validationCode":"String saved = savedClusterNameFromSystemLocal(); // e.g. via cqlsh or sstable metadata\nif (saved != null && !saved.equals(yamlClusterName))\n    throw new IllegalStateException(\"cluster_name mismatch: yaml=\" + yamlClusterName + \" saved=\" + saved);","typeGuard":"null","tryCatchPattern":"try { startCassandra(); } catch (ConfigurationException e) { if (e.getMessage().contains(\"Saved cluster name\")) { /* align cassandra.yaml or re-bootstrap */ } else throw e; }","preventionTips":["Treat cluster_name as immutable for a data directory; change only with a full re-bootstrap","Configuration management should not template cluster_name on existing nodes","Verify data_dir + cluster_name pairing when provisioning environments"],"tags":["startup","cluster-name","configuration","mismatch"],"backgroundTag":"invalid-config-value","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"}