How to undo setting Elasticsearch Index to readonly?

The correct way to make es index read-only is

PUT your_index/_settings
{
  "index": {
    "blocks.read_only": true
  }
}

change true to false to undo it.

You set non dynamic setting with

   {
      "index": {
        "index.blocks.read_only": false
      }
    }

which I think was not your intention. Also I think you should have seen an error during first operation itself as non dynamic settings can be updated only on close indices.

run

POST your_index/_close

and then try changing it.


Answers are really old so I'll add a elastic-6+ answer too:

PUT /[_all|<index-name>]/_settings
{
  "index.blocks.read_only_allow_delete": null
}

https://www.elastic.co/guide/en/elasticsearch/reference/6.x/disk-allocator.html

FYI (for context): I ran into read-only indices due to running out of disk and got error messages from logstash:

...retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked"

elasticsearch:
ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]


curl -X PUT "localhost:9200/_all/_settings" -H 'Content-Type: application/json' -d'{ "index.blocks.read_only" : false } }'