opensearch-project / opensearch-java

Java Client for OpenSearch
Apache License 2.0
118 stars 182 forks source link

[BUG] Unable to set/unset index blocks to read_only #871

Open pardhukota-pk opened 7 months ago

pardhukota-pk commented 7 months ago

I am using opensearch-java-2.8.0 and trying to set the index block to read_only using the below code.

PutIndicesSettingsResponse response = elasticSearchIndicesClient.putSettings(b->b.index(index)
                .settings(s->s.blocksReadOnly(true)));

and then trying to unset it by passing false

I get the below error while unsetting it.

org.opensearch.client.opensearch._types.OpenSearchException: Request failed: [cluster_block_exception] index ["some_index"] blocked by: [FORBIDDEN/5/index read-only (api)];

Please let me know the correct way to set it and you can close this if this is not a issue.

dblock commented 5 months ago

@pardhukota-pk Is this a client problem or server? can you reproduce the same issue with curl?