apache/cassandra · critical · ConfigurationException
DC or rack not found in snitch properties, check your…
Error message
DC or rack not found in snitch properties, check your configuration in: cassandra-rackdc.properties
What it means
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.
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
Example fix
// before (cassandra-rackdc.properties) dc=dc1 # rack line missing // after dc=dc1 rack=rack1
Defensive patterns
Strategy: validation
Validate before calling
import org.apache.cassandra.locator.SnitchProperties;
Properties p = SnitchProperties.fromFile("conf/cassandra-rackdc.properties");
if (!p.containsKey("dc") || !p.containsKey("rack"))
throw new IllegalStateException("cassandra-rackdc.properties must define dc and rack"); Try / catch
try { startNode(); } catch (ConfigurationException e) { if (e.getMessage().contains("cassandra-rackdc.properties")) { /* fix file, restart */ } } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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='.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Unable to read cassandra-topology.properties
- Configuration must specify either node_proximity and…
- Initial location provider rejected registration location…
- is deprecated and not actively maintained. It will be…
- is deprecated and not actively maintained. It will be…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/8b59b761663e5a29.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/locator/RackDCFileLocationProvider.java:66
* @param properties
*/
RackDCFileLocationProvider(SnitchProperties properties)
{
local = new Location(properties.get("dc", DEFAULT.datacenter).trim(),
properties.get("rack", DEFAULT.rack).trim());
}
@Override
public Location initialLocation()
{
return local;
}
public static SnitchProperties loadConfiguration() throws ConfigurationException
{
final SnitchProperties properties = new SnitchProperties();
if (!properties.contains("dc") || !properties.contains("rack"))
throw new ConfigurationException("DC or rack not found in snitch properties, check your configuration in: " + SnitchProperties.RACKDC_PROPERTY_FILENAME);
return properties;
}
}
View on GitHub (pinned to 88fd0f6a0e)