apache/cassandra · error · ConfigurationException
Multiple entries for DC
Error message
Multiple entries for DC %s
What it means
When splitting the 'dcs' option on commas, each entry is parsed into a WeightedDc and inserted into a map keyed by DC name. If the same DC name appears more than once, the duplicate insertion is rejected with a ConfigurationException instead of silently overwriting.
Solutions
- Remove duplicate entries from the 'dcs' list so each DC appears once
- Normalize DC casing before building the list (e.g. all lowercase)
- Deduplicate in tooling that generates the dcs string from multiple sources
Example fix
// before
Map<String,String> opts = Map.of("dcs", "dc1,dc1=0.5");
ParameterizedFastPathStrategy.fromMap(opts); // throws
// after
Map<String,String> opts = Map.of("dcs", "dc1=0.5");
ParameterizedFastPathStrategy.fromMap(opts); // ok Defensive patterns
Strategy: validation
Validate before calling
Set<String> seen = new HashSet<>();
for (String dc : dcsString.split(",")) {
if (!seen.add(dc.trim()))
throw new IllegalArgumentException("duplicate DC entry: " + dc);
} Prevention
- Deduplicate DC lists at config-generation time
- Normalize DC name casing consistently across the cluster
When it happens
Trigger: Calling fromMap() with {"dcs": "dc1,dc1"} or case/format variants that parse to the same name, e.g. "dc1:auto,dc1=0.5".
Common situations: Appending a DC to an existing list without noticing it was already present; scripted config generation concatenating overlapping DC sets; inconsistent casing across entries.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- accord.cache_size option was set incorrectly to
- accord.journal_directory must be specified
- accord.journal_directory must not be the same as any…
- Cannot change transactional mode to
- Cannot create table . with transactional mode with…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/0e92c658b586b8ce.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/service/accord/topology/ParameterizedFastPathStrategy.java:274
if (size < 1)
throw cfe("%s must be greater than zero", SIZE);
ImmutableMap<String, WeightedDc> dcMap;
if (map.containsKey(DCS) && !map.get(DCS).isEmpty())
{
Map<String, WeightedDc> mutableDcs = new HashMap<>();
String dcsString = map.get(DCS);
if (dcsString.trim().isEmpty())
throw cfe("%s must specify at least one DC", DCS);
int autoIdx = 0;
boolean hasAuto = false;
boolean hasManual = false;
for (String dcString : COMMA_SEPARATOR.split(dcsString))
{
WeightedDc dc = WeightedDc.fromString(dcString, autoIdx++);
if (mutableDcs.containsKey(dc.name))
throw cfe("Multiple entries for DC %s", dc.name);
if (dc.autoWeight)
{
if (hasManual) throw cfe("Cannot mix auto and manual DC weights");
hasAuto = true;
}
else
{
if (hasAuto) throw cfe("Cannot mix auto and manual DC weights");
hasManual = true;
}
mutableDcs.put(dc.name, dc);
}
dcMap = ImmutableMap.copyOf(mutableDcs);
}
else
{View on GitHub (pinned to 88fd0f6a0e)