NationalSecurityAgency/ghidra · error · ElasticException
Unknown response trying to adjust number_of_replicas and ref
Error message
Unknown response trying to adjust number_of_replicas and refresh_interval
What it means
Thrown in adjustReplicaRefresh when the response to a PUT index/_settings request does not contain an "acknowledged" field (ElasticConnection.isNull(ack) is true). The standard Elasticsearch settings-update response includes an acknowledged boolean; its absence means the server returned a non-standard response, an error envelope, or an authentication challenge that was not caught as an HTTP-level failure.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:1939
*/
private void adjustReplicaRefresh(String index, int numReplicas, int refreshRateInSecs)
throws ElasticException {
StringBuilder builder = new StringBuilder();
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\": { ");View on GitHub (pinned to d5f144c24d)
Solutions
- Manually issue the PUT index/_settings request via curl and inspect the raw response body to determine what the server actually returned.
- Verify the Elasticsearch server version is compatible with this BSim client.
- Check authentication credentials — a 401 Unauthorized may produce a response without the acknowledged field.
- Remove any HTTP proxy or gateway that might alter or replace the response body.
Defensive patterns
Strategy: validation
Validate before calling
// Before adjusting settings, verify the server is reachable and responding normally
JsonObject health = connection.executeURIOnly(ElasticConnection.GET, "_cluster/health");
if (health == null || ElasticConnection.isNull(health.get("status"))) {
throw new IllegalStateException("Elasticsearch server not responding normally");
} Try / catch
try {
database.query(adjustQuery);
} catch (ElasticException e) {
if (e.getMessage().contains("Unknown response")) {
// Server returned non-standard response — check version/auth/proxy
Msg.error(this, "Settings update returned unexpected response: " + e.getMessage());
}
throw e;
} Prevention
- Verify Elasticsearch version compatibility before issuing settings commands.
- Ensure authentication credentials are valid — a 401 may produce a non-standard response.
- Bypass HTTP proxies that might modify response bodies for Elasticsearch traffic.
When it happens
Trigger: Called during database creation or during adjust/ingest-optimization commands that tune number_of_replicas and refresh_interval. The PUT _settings response is parsed and resp.get("acknowledged") returns null or a JsonNull.
Common situations: Incompatible Elasticsearch version that returns a different response shape; HTTP proxy returning an error page instead of JSON; authentication failure (401) whose body lacks the acknowledged field; network timeout producing a truncated or empty response body.
Related errors
- Cluster did not accept settings for index:
- Could not find hits document
- Multi-search for exe records failed
- Database instance does not exist
- Unrecoverable error: Could not find configuration
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/7747fe6cf7433121.
Report an issue: GitHub.