# Lifecycle policy setting index read-only even with the option disabled

**URL:** <https://discuss.elastic.co/t/lifecycle-policy-setting-index-read-only-even-with-the-option-disabled/284572>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [September 19, 2021, 2:58pm UTC](https://discuss.elastic.co/t/lifecycle-policy-setting-index-read-only-even-with-the-option-disabled/284572 "2021-09-19T14:58:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 19, 2021, 2:58pm UTC](https://discuss.elastic.co/t/lifecycle-policy-setting-index-read-only-even-with-the-option-disabled/284572/1 "2021-09-19T14:58:30Z")

</div>

Hello,

I have a hot-warm architecture and a couple of ILM that will move the index from the hot nodes to the warm nodes based on the age.

I have an index that is created daily and is moved to the warm nodes after 7 days, to do this I created a Lifecycle Policy using the Kibana UI where I set the number of days and I checked the `force merge` option, I didn't checked the `read only` option.

It is possible that for some cases I can get documents that need to be indexed in these indices even after they were moved to the `warm` nodes, that's why I didn't checked the `read only` option, but I'm getting some `FORBIDDEN/8/index write (api)` errors in logstash and when I looked at the index they were set to read only (`"index.blocks.write": "true"`).

I'm using version 7.12.1 currently, an update is planned but no date defined yet.

Is this a bug? What could be setting the index to `read only`?

This is my policy:

```auto
{
  "redacted-ilm-policy" : {
    "version" : 5,
    "modified_date" : "2021-09-19T14:48:23.390Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "delete" : {
          "min_age" : "61d",
          "actions" : {
            "delete" : {
              "delete_searchable_snapshot" : true
            }
          }
        },
        "warm" : {
          "min_age" : "7d",
          "actions" : {
            "allocate" : {
              "include" : { },
              "exclude" : { },
              "require" : {
                "node_type" : "warm"
              }
            },
            "forcemerge" : {
              "max_num_segments" : 1
            },
            "set_priority" : {
              "priority" : 50
            }
          }
        }
      }
    }
  }
}

```

The modified date is recent because I saved it again but no changes were made.

These are the settings of an index in the warm phase with the writes blocked.

```auto
{
  "index.blocks.read_only_allow_delete": "false",
  "index.write.wait_for_active_shards": "1",
  "index.mapping.ignore_malformed": "true",
  "index.refresh_interval": "30s",
  "index.blocks.write": "true",
  "index.query.default_field": [
    "message"
  ],
  "index.priority": "50",
  "index.number_of_replicas": "0",
  "index.lifecycle.name": "redacted-ilm-policy",
  "index.routing.allocation.require.node_type": "warm"
}

```

I was able to temporarily solve this issue by manually setting the `index.blocks.write` to null in every index, but I expect the ILM to works as defined so I would not need to create a crontab just to set this.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 19, 2021, 4:07pm UTC](https://discuss.elastic.co/t/lifecycle-policy-setting-index-read-only-even-with-the-option-disabled/284572/2 "2021-09-19T16:07:43Z")

</div>

Well,

I think it is related to these issues in github:

- [[ILM] Allow option to disable readonly action on index](https://github.com/elastic/elasticsearch/issues/43426#)
- [ILM: Add option to disable setting indices to read-only when force merge is executed](https://github.com/elastic/elasticsearch/issues/53289#)

If you have a `force merge` action in your Lifecycle Policy it will set the index to read-only even if you do not check the `read-only` action.

---

<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:** [October 17, 2021, 4:08pm UTC](https://discuss.elastic.co/t/lifecycle-policy-setting-index-read-only-even-with-the-option-disabled/284572/3 "2021-10-17T16:08:04Z")

</div>

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