# Force merge on read\_only index yields error

**URL:** <https://discuss.elastic.co/t/force-merge-on-read-only-index-yields-error/136528>\
**Category:** Elasticsearch\
**Created:** [June 19, 2018, 3:33pm UTC](https://discuss.elastic.co/t/force-merge-on-read-only-index-yields-error/136528 "2018-06-19T15:33:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reswob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reswob/32/38015_2.png) [@reswob](https://discuss.elastic.co/u/reswob)\
**Post date:** [June 19, 2018, 3:33pm UTC](https://discuss.elastic.co/t/force-merge-on-read-only-index-yields-error/136528/1 "2018-06-19T15:33:32Z")

</div>

I'm looking to manage some of our old indices by making them read only and force merging them down to one segment. According to  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html)  
I'm supposed to set the index to read only first so:

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

```

at which point I received "acknowledged" : "true"

Then next I submitted:

```
POST my_index/_forcemerge?max_num_segments=1

```

at which point I had returned:

```
"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/5/index read-only / allow delete (api)];"
"status": 403

```

huh?  
Does this mean I DON'T set the index to read\_only?  
Or is there something else going on?

The two nodes this particular index is on are low on disk space (which is one of the reasons I'm doing this), so I'm wondering if that is a factor.

Thanks.

---

<div class="post-metadata">

**Author:** ![reswob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reswob/32/38015_2.png) [@reswob](https://discuss.elastic.co/u/reswob)\
**Post date:** [June 20, 2018, 5:46pm UTC](https://discuss.elastic.co/t/force-merge-on-read-only-index-yields-error/136528/2 "2018-06-20T17:46:28Z")

</div>

Support pointed out what I missed: I'm on version 5.6.3 and the instructions I was following were for 6.x. In version 5.6.x, according to:

you do not need to make the index read only before doing a force merge.

---

<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 18, 2018, 5:46pm UTC](https://discuss.elastic.co/t/force-merge-on-read-only-index-yields-error/136528/3 "2018-07-18T17:46:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
