NationalSecurityAgency/ghidra · error · ElasticException
Cluster did not accept settings for index:
Error message
Cluster did not accept settings for index:
What it means
Thrown in adjustReplicaRefresh when the "acknowledged" field is present but false. The Elasticsearch cluster master node explicitly refused the settings update for the named index. The index name is appended to the error message for diagnostics.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:1943
builder.append("{ \"index\": { ");
builder.append(" \"number_of_replicas\": ").append(numReplicas).append(", ");
builder.append(" \"refresh_interval\": \"");
if (refreshRateInSecs < 1) {
builder.append("-1"); // Indicates that no refreshes are scheduled
}
else {
builder.append(refreshRateInSecs).append('s');
}
builder.append("\" } }");
JsonObject resp = connection.executeStatement(ElasticConnection.PUT, index + "/_settings",
builder.toString());
JsonElement ack = resp.get("acknowledged");
if (ElasticConnection.isNull(ack)) {
throw new ElasticException(
"Unknown response trying to adjust number_of_replicas and refresh_interval");
}
if (!ack.getAsBoolean()) {
throw new ElasticException("Cluster did not accept settings for index: " + index);
}
}
/**
* This routine establishes the schema for the "vector" and "meta" document types
* for a new database. It also sets up weights and hashes for the vector tokenizer (lsh_tokenizer).
* @param config contains database configuration info
* @throws ElasticException for communication problems with the server
*/
private void createVectorIndex(Configuration config) throws ElasticException {
StringBuilder builder = new StringBuilder();
builder.append("{ \"settings\": { ");
builder.append(" \"index\": { ");
builder.append(" \"analysis\": { ");
builder.append(" \"tokenizer\": { ");
builder.append(" \"lsh_").append(repository).append("\": { ");
builder.append(" \"type\": \"lsh_tokenizer\", ");
builder.append(" \"").append(ElasticUtilities.LSH_WEIGHTS).append("\": ");View on GitHub (pinned to d5f144c24d)
Solutions
- Check cluster health: ensure enough data nodes exist for the requested replica count (GET _cluster/health).
- Clear read-only blocks: PUT <index>/_settings {"index.blocks.read_only": null}.
- Free disk space if the flood-stage watermark triggered a read-only block (check GET _cluster/allocation/explain).
- Verify the index name passed to adjustReplicaRefresh is correct and that the index exists.
Defensive patterns
Strategy: validation
Validate before calling
// Before adjusting replicas, check cluster health and node count
JsonObject health = connection.executeURIOnly(ElasticConnection.GET, "_cluster/health");
String status = ElasticConnection.convertToString(health.get("status"));
if ("red".equals(status)) {
throw new IllegalStateException("Cluster is red; cannot adjust index settings");
}
int dataNodes = health.get("number_of_data_nodes").getAsInt();
if (numReplicas >= dataNodes) {
throw new IllegalArgumentException("Replica count exceeds data node count: " + dataNodes);
} Try / catch
try {
database.query(adjustQuery);
} catch (ElasticException e) {
if (e.getMessage().startsWith("Cluster did not accept settings")) {
// Clear read-only blocks and retry
Msg.warn(this, "Settings rejected — checking for read-only blocks: " + e.getMessage());
}
throw e;
} Prevention
- Verify sufficient data nodes exist for the requested replica count before adjusting settings.
- Clear index.blocks.read_only before attempting settings changes.
- Monitor disk watermarks to prevent flood-stage read-only blocks.
When it happens
Trigger: Called when adjusting number_of_replicas or refresh_interval for a specific index (e.g., during pre-ingest optimization via adjustReplicaRefresh). The cluster processes the PUT _settings request and returns acknowledged=false.
Common situations: Requested replica count exceeds available data nodes; index.blocks.read_only or index.blocks.metadata is set; disk watermark exceeded triggering read-only-allow-delete; cluster state is red and the master cannot process index metadata changes.
Related errors
- Unknown response trying to adjust number_of_replicas and ref
- Database instance does not exist
- Unrecoverable error: Could not find configuration
- Missing critical configuration value:
- weighttable has wrong number of rows
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/b476d07b0700c14b.
Report an issue: GitHub.