# ILM phase don't delete indexes (els 7.9)

**URL:** <https://discuss.elastic.co/t/ilm-phase-dont-delete-indexes-els-7-9/263704>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 9, 2021, 9:25am UTC](https://discuss.elastic.co/t/ilm-phase-dont-delete-indexes-els-7-9/263704 "2021-02-09T09:25:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakabluk](https://avatars.discourse-cdn.com/v4/letter/z/8baadc/32.png) [@zakabluk](https://discuss.elastic.co/u/zakabluk)\
**Post date:** [February 9, 2021, 9:25am UTC](https://discuss.elastic.co/t/ilm-phase-dont-delete-indexes-els-7-9/263704/1 "2021-02-09T09:25:29Z")

</div>

My ILM policy

```auto
PUT _ilm/policy/delete-after-7-days
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "7d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }

```

GET .ds-logstash-f-lb-2021.01.29-000001/\_ilm/explain

```auto
  "indices" : {
    ".ds-logstash-fornex-lb-2021.01.29-000001" : {
      "index" : ".ds-logstash-f-lb-2021.01.29-000001",
      "managed" : true,
      "policy" : "delete-after-7-days",
      "lifecycle_date_millis" : 1611878426807,
      "age" : "11.38d",
      "phase" : "delete",
      "phase_time_millis" : 1612483233516,
      "action" : "delete",
      "action_time_millis" : 1612483233516,
      "step" : "delete",
      "step_time_millis" : 1612483781849,
      "phase_execution" : {
        "policy" : "delete-after-7-days",
        "phase_definition" : {
          "min_age" : "7d",
          "actions" : {
            "delete" : {
              "delete_searchable_snapshot" : true
            }
          }
        },
        "version" : 4,
        "modified_date_in_millis" : 1612254154538
      }

```

index not deleted today is 2021 feb 09. I don't understand why

---

<div class="post-metadata">

**Author:** ![zakabluk](https://avatars.discourse-cdn.com/v4/letter/z/8baadc/32.png) [@zakabluk](https://discuss.elastic.co/u/zakabluk)\
**Post date:** [February 10, 2021, 11:08am UTC](https://discuss.elastic.co/t/ilm-phase-dont-delete-indexes-els-7-9/263704/2 "2021-02-10T11:08:06Z")

</div>

In logs I see error

```auto
"stacktrace": ["java.lang.IllegalStateException: index [.ds-logstash-f-lb-2021.01.29-000001] is the write index for data stream [logstash-f-lb-2021.01.29]. stopping execution of lifecycle [delete-after-7-days] as a data stream's write index cannot be deleted. manually rolling over the index will resume the execution of the policy as the index will not be the data stream's write index anymore",
"at 

```

---

<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:** [March 10, 2021, 11:08am UTC](https://discuss.elastic.co/t/ilm-phase-dont-delete-indexes-els-7-9/263704/3 "2021-03-10T11:08:24Z")

</div>

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