{"record":{"id":"8b59b761663e5a29","repo":"apache/cassandra","slug":"dc-or-rack-not-found-in-snitch-properties-check-y","errorCode":null,"errorMessage":"DC or rack not found in snitch properties, check your configuration in: cassandra-rackdc.properties","messagePattern":"DC or rack not found in snitch properties, check your configuration in: cassandra-rackdc\\.properties","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/locator/RackDCFileLocationProvider.java","lineNumber":66,"sourceCode":"     * @param properties\n     */\n    RackDCFileLocationProvider(SnitchProperties properties)\n    {\n        local = new Location(properties.get(\"dc\", DEFAULT.datacenter).trim(),\n                             properties.get(\"rack\", DEFAULT.rack).trim());\n    }\n\n    @Override\n    public Location initialLocation()\n    {\n        return local;\n    }\n\n    public static SnitchProperties loadConfiguration() throws ConfigurationException\n    {\n        final SnitchProperties properties = new SnitchProperties();\n        if (!properties.contains(\"dc\") || !properties.contains(\"rack\"))\n            throw new ConfigurationException(\"DC or rack not found in snitch properties, check your configuration in: \" + SnitchProperties.RACKDC_PROPERTY_FILENAME);\n\n        return properties;\n    }\n\n\n}\n","sourceCodeStart":48,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/locator/RackDCFileLocationProvider.java#L48-L73","documentation":"RackDCFileLocationProvider loads cassandra-rackdc.properties to determine this node's datacenter and rack for snitch-based placement. If the properties file (as resolved via system properties/snitch properties) does not contain both a 'dc' and a 'rack' entry, loadConfiguration throws this ConfigurationException at node startup/registration time.","triggerScenarios":"Starting a node with a snitch that depends on cassandra-rackdc.properties (e.g. GossipingPropertyFileSnitch) where the file lacks 'dc=' or 'rack=' lines, or the file cannot be found via cassandra-rackdc.properties system property.","commonSituations":"Fresh install with an untouched/empty rackdc file; misconfigured cassandra-env.ps1/-sh not pointing at the right file; copy of config missing during container image build; typos like 'datacenter=' instead of 'dc='.","solutions":["Edit conf/cassandra-rackdc.properties and define both keys: dc=<your_dc> and rack=<your_rack>","Set the cassandra-rackdc.properties system property to the correct file path if using a custom location","Restart Cassandra after fixing the file"],"exampleFix":"// before (cassandra-rackdc.properties)\ndc=dc1\n# rack line missing\n// after\ndc=dc1\nrack=rack1","handlingStrategy":"validation","validationCode":"import org.apache.cassandra.locator.SnitchProperties;\nProperties p = SnitchProperties.fromFile(\"conf/cassandra-rackdc.properties\");\nif (!p.containsKey(\"dc\") || !p.containsKey(\"rack\"))\n    throw new IllegalStateException(\"cassandra-rackdc.properties must define dc and rack\");","typeGuard":null,"tryCatchPattern":"try { startNode(); } catch (ConfigurationException e) { if (e.getMessage().contains(\"cassandra-rackdc.properties\")) { /* fix file, restart */ } }","preventionTips":["Include dc= and rack= in every deployment's cassandra-rackdc.properties (bake into images)","Validate config in CI/container entrypoint before launching Cassandra","Never leave the default rackdc template untouched in production"],"tags":["configuration","snitch","properties-file"],"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-17T15:17:12.973Z"}