# Read only on index prevents getting status

**URL:** <https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973>\
**Category:** Elasticsearch\
**Created:** [March 13, 2012, 9:45am UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973 "2012-03-13T09:45:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruflin\_2](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruflin\_2](https://discuss.elastic.co/u/ruflin_2)\
**Post date:** [March 13, 2012, 9:45am UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973/1 "2012-03-13T09:45:36Z")

</div>

I started to use the new read only feature in ES 0.19.0. After I set some  
indices to readOnly, status does not work anymore. Here is a snippet to  
reproduce it:

curl -XPUT [http://localhost:9200/4f5f157e894cd/](http://localhost:9200/4f5f157e894cd/) -d '[]'  
curl -XPOST [http://localhost:9200/\_aliases](http://localhost:9200/_aliases) -d  
'{"actions":[{"add":{"index":"4f5f157e894cd","alias":"4f5f157e9ec22"}}]}'  
curl -XPUT [http://localhost:9200/4f5f157e894cd/\_settings](http://localhost:9200/4f5f157e894cd/_settings) -d  
'{"index":{"blocks.read\_only":true}}'  
curl -XGET [http://localhost:9200/\_status](http://localhost:9200/_status)

This outputs:

{"error":"ClusterBlockException[blocked by: [FORBIDDEN/5/index read-only  
(api)];]","status":403}

As status is only a GET request I would expect it to work.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 13, 2012, 9:57am UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973/2 "2012-03-13T09:57:29Z")

</div>

Hiya Ruflin

On Tue, 2012-03-13 at 02:45 -0700, ruflin wrote:

> I started to use the new read only feature in ES 0.19.0. After I set  
> some indices to readOnly, status does not work anymore. Here is a  
> snippet to reproduce it:

I think this may be fixed in 0.19.1:

> <https://github.com/elastic/elasticsearch/issues/1771>
>
> Allow to specifically block (on an index level) write operations, read operation…s and metadata operations. Setting \`index.blocks.write\` to \`true\` will block write operations, setting it back to \`false\` will allow them. The settings can be dynamically set using the index update settings API.

clint

> curl -XPUT [http://localhost:9200/4f5f157e894cd/](http://localhost:9200/4f5f157e894cd/) -d ''  
> curl -XPOST [http://localhost:9200/\_aliases](http://localhost:9200/_aliases) -d  
> '{"actions":[{"add":{"index":"4f5f157e894cd","alias":"4f5f157e9ec22"}}]}'  
> curl -XPUT [http://localhost:9200/4f5f157e894cd/\_settings](http://localhost:9200/4f5f157e894cd/_settings) -d  
> '{"index":{"blocks.read\_only":true}}'  
> curl -XGET [http://localhost:9200/\_status](http://localhost:9200/_status)
> 
> This outputs:
> 
> {"error":"ClusterBlockException[blocked by: [FORBIDDEN/5/index  
> read-only (api)];]","status":403}
> 
> As status is only a GET request I would expect it to work.

---

<div class="post-metadata">

**Author:** ![Philipp\_Gysin](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Philipp\_Gysin](https://discuss.elastic.co/u/Philipp_Gysin)\
**Post date:** [May 3, 2012, 10:44am UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973/3 "2012-05-03T10:44:57Z")

</div>

Afraid this might still be an issue

After upgrading both ES and Elastica [https://github.com/ruflin/Elastica](https://github.com/ruflin/Elastica)to 0.19.3 I still get the error as above

Cheers,  
Philipp

On Tuesday, March 13, 2012 10:57:29 AM UTC+1, Clinton Gormley wrote:

> I think this may be fixed in 0.19.1:
> 
> [Index Blocks: Add index.blocks.write, index.blocks.read, and index.blocks.metadata settings · Issue #1771 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1771)
> 
> clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 4, 2012, 1:16pm UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973/4 "2012-05-04T13:16:44Z")

</div>

Setting the index to readonly means you can't issue WRITE and METADATA  
(status/stats are METADATA calls). In 0.19.2, you can now explicitly set  
blocks to read, write or metadata. See here:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

.

On Thu, May 3, 2012 at 1:44 PM, Philipp Gysin [philipp.gysin@gmail.com](mailto:philipp.gysin@gmail.com)wrote:

> Afraid this might still be an issue
> 
> After upgrading both ES and Elastica [https://github.com/ruflin/Elastica](https://github.com/ruflin/Elastica)to 0.19.3 I still get the error as above
> 
> Cheers,  
> Philipp
> 
> On Tuesday, March 13, 2012 10:57:29 AM UTC+1, Clinton Gormley wrote:
> 
> > I think this may be fixed in 0.19.1:
> > 
> > [https://github.com/\*\*elasticsearch/elasticsearch/\*\*issues/1771](https://github.com/ **elasticsearch/elasticsearch/** issues/1771)[https://github.com/elasticsearch/elasticsearch/issues/1771](https://github.com/elasticsearch/elasticsearch/issues/1771)
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:30am UTC](https://discuss.elastic.co/t/read-only-on-index-prevents-getting-status/6973/5 "2017-07-06T03:30:09Z")

</div>


