{"record":{"id":"bb3b8da48ea0a9b7","repo":"apache/cassandra","slug":"initial-location-provider-rejected-registration-lo","errorCode":null,"errorMessage":"Initial location provider rejected registration location, please check the system log for errors","messagePattern":"Initial location provider rejected registration location, please check the system log for errors","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/locator/SnitchAdapter.java","lineNumber":53,"sourceCode":"    {\n        this.snitch = snitch;\n    }\n\n    @Override\n    public Location initialLocation()\n    {\n        return new Location(snitch.getLocalDatacenter(), snitch.getLocalRack());\n    }\n\n    @Override\n    public void validate(ClusterMetadata metadata)\n    {\n        Set<String> datacenters = metadata.directory.allDatacenterRacks().keySet();\n        Set<String> racks = new HashSet<>();\n        for (String dc : datacenters)\n            racks.addAll(metadata.directory.datacenterRacks(dc).keySet());\n        if (!snitch.validate(datacenters, racks))\n            throw new ConfigurationException(\"Initial location provider rejected registration location, \" +\n                                             \"please check the system log for errors\");\n    }\n\n    @Override\n    public <C extends ReplicaCollection<? extends C>> C sortedByProximity(InetAddressAndPort address, C addresses)\n    {\n        return snitch.sortedByProximity(address, addresses);\n    }\n\n    @Override\n    public int compareEndpoints(InetAddressAndPort target, Replica r1, Replica r2)\n    {\n        return snitch.compareEndpoints(target, r1, r2);\n    }\n\n    @Override\n    public boolean isWorthMergingForRangeQuery(ReplicaCollection<?> merged, ReplicaCollection<?> l1, ReplicaCollection<?> l2)\n    {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/locator/SnitchAdapter.java#L35-L71","documentation":"SnitchAdapter bridges the configured IEndpointSnitch to the initial location provider used during node registration. During startup, the snitch's validate() is called with the set of all datacenters and racks known in schema metadata; if the snitch rejects them (e.g. it cannot place this node in a known DC/rack), a ConfigurationException with this generic message is thrown, with details written to the system log.","triggerScenarios":"Node startup/registration when the snitch (e.g. property-file or dynamic snitch wrapper) cannot reconcile this node's location (from cassandra-rackdc.properties or cassandra-topology.properties) with the DCs/racks registered in the cluster metadata.","commonSituations":"Mismatch between the local snitch config values and the DC names used by the rest of the cluster; changing snitch classes without aligning dc/rack names; malformed rackdc/topology files causing the snitch to log errors and fail validation.","solutions":["Check the system log lines preceding the exception for the snitch's specific validation error","Ensure the local snitch config (cassandra-rackdc.properties / cassandra-topology.properties) declares dc/rack names matching the cluster's datacenters","Restart Cassandra after correcting the snitch configuration"],"exampleFix":"// before (cassandra-rackdc.properties)\ndc=DataCenter1  // cluster uses 'dc1'\n// after\ndc=dc1\nrack=rack1","handlingStrategy":"validation","validationCode":"Set<String> knownDcs = schema.getAllDatacenters();\nString localDc = readFromRackdcProperties(\"dc\");\nString localRack = readFromRackdcProperties(\"rack\");\nif (!knownDcs.isEmpty() && !knownDcs.contains(localDc))\n    throw new IllegalStateException(\"Local dc '\" + localDc + \"' not among cluster DCs \" + knownDcs);","typeGuard":null,"tryCatchPattern":"try { startNode(); }\ncatch (ConfigurationException e) { if (e.getMessage().contains(\"rejected registration location\")) { /* read system log for snitch detail, fix config, restart */ } }","preventionTips":["Use identical dc/rack naming conventions across the cluster","Validate snitch files against cluster DC names before rolling restarts","Avoid changing snitch class and location files without a coordinated plan"],"tags":["snitch","startup","configuration"],"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"}