{"record":{"id":"b476d07b0700c14b","repo":"NationalSecurityAgency/ghidra","slug":"cluster-did-not-accept-settings-for-index","errorCode":null,"errorMessage":"Cluster did not accept settings for index: ","messagePattern":"Cluster did not accept settings for index: ","errorType":"exception","errorClass":"ElasticException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java","lineNumber":1943,"sourceCode":"\t\tbuilder.append(\"{ \\\"index\\\": { \");\n\t\tbuilder.append(\"  \\\"number_of_replicas\\\": \").append(numReplicas).append(\", \");\n\t\tbuilder.append(\"  \\\"refresh_interval\\\": \\\"\");\n\t\tif (refreshRateInSecs < 1) {\n\t\t\tbuilder.append(\"-1\");\t\t// Indicates that no refreshes are scheduled\n\t\t}\n\t\telse {\n\t\t\tbuilder.append(refreshRateInSecs).append('s');\n\t\t}\n\t\tbuilder.append(\"\\\" } }\");\n\t\tJsonObject resp = connection.executeStatement(ElasticConnection.PUT, index + \"/_settings\",\n\t\t\tbuilder.toString());\n\t\tJsonElement ack = resp.get(\"acknowledged\");\n\t\tif (ElasticConnection.isNull(ack)) {\n\t\t\tthrow new ElasticException(\n\t\t\t\t\"Unknown response trying to adjust number_of_replicas and refresh_interval\");\n\t\t}\n\t\tif (!ack.getAsBoolean()) {\n\t\t\tthrow new ElasticException(\"Cluster did not accept settings for index: \" + index);\n\t\t}\n\t}\n\n\t/**\n\t * This routine establishes the schema for the \"vector\" and \"meta\" document types\n\t * for a new database. It also sets up weights and hashes for the vector tokenizer (lsh_tokenizer).\n\t * @param config contains database configuration info\n\t * @throws ElasticException for communication problems with the server\n\t */\n\tprivate void createVectorIndex(Configuration config) throws ElasticException {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"{ \\\"settings\\\": { \");\n\t\tbuilder.append(\"  \\\"index\\\": { \");\n\t\tbuilder.append(\"    \\\"analysis\\\": { \");\n\t\tbuilder.append(\"      \\\"tokenizer\\\": { \");\n\t\tbuilder.append(\"        \\\"lsh_\").append(repository).append(\"\\\": { \");\n\t\tbuilder.append(\"          \\\"type\\\": \\\"lsh_tokenizer\\\", \");\n\t\tbuilder.append(\"          \\\"\").append(ElasticUtilities.LSH_WEIGHTS).append(\"\\\": \");","sourceCodeStart":1925,"sourceCodeEnd":1961,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java#L1925-L1961","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before adjusting replicas, check cluster health and node count\nJsonObject health = connection.executeURIOnly(ElasticConnection.GET, \"_cluster/health\");\nString status = ElasticConnection.convertToString(health.get(\"status\"));\nif (\"red\".equals(status)) {\n    throw new IllegalStateException(\"Cluster is red; cannot adjust index settings\");\n}\nint dataNodes = health.get(\"number_of_data_nodes\").getAsInt();\nif (numReplicas >= dataNodes) {\n    throw new IllegalArgumentException(\"Replica count exceeds data node count: \" + dataNodes);\n}","typeGuard":null,"tryCatchPattern":"try {\n    database.query(adjustQuery);\n} catch (ElasticException e) {\n    if (e.getMessage().startsWith(\"Cluster did not accept settings\")) {\n        // Clear read-only blocks and retry\n        Msg.warn(this, \"Settings rejected — checking for read-only blocks: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["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."],"tags":["elasticsearch","bsim","settings","cluster-health","configuration","acknowledged"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}