# Getting error when indices getting rollover with ILM policy

**URL:** <https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410>\
**Category:** Elastic Observability\
**Tags:** ilm-index-lifecycle-management\
**Created:** [September 11, 2024, 12:34pm UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410 "2024-09-11T12:34:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajeev\_Aminbhavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajeev_aminbhavi/32/137524_2.png) [@Rajeev\_Aminbhavi](https://discuss.elastic.co/u/Rajeev_Aminbhavi)\
**Post date:** [September 11, 2024, 12:34pm UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/1 "2024-09-11T12:34:16Z")

</div>

Hi there,

I am getting ILM errors on all of my indexes. For example:

```auto
stack_trace" : "java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [jaeger-span] does not point to index [jaeger-span-2024-08-02]\n\tat org.elasticsearch.xpack.core.ilm.RolloverStep.performAction(RolloverStep.java:73)\n\tat org.elasticsearch.xpack.ilm.IndexLifecycleRunner.maybeRunAsyncAction(IndexLifecycleRunner.java:294)\n\tat org.elasticsearch.xpack.ilm.IndexLifecycleRunner$2.clusterStateProcessed(IndexLifecycleRunner.java:250)\n\tat org.elasticsearch.cluster.service.MasterService$SafeClusterStateTaskListener.clusterStateProcessed(MasterService.java:534)\n\tat org.elasticsearch.cluster.service.MasterService$TaskOutputs.lambda$processedDifferentClusterState$1(MasterService.java:421)\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1511)\n\tat org.elasticsearch.cluster.service.MasterService$TaskOutputs.processedDifferentClusterState(MasterService.java:421)\n\tat org.elasticsearch.cluster.service.MasterService.onPublicationSuccess(MasterService.java:281)\n\tat org.elasticsearch.cluster.service.MasterService.publish(MasterService.java:273)\n\tat org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:250)\n\tat org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73)\n\tat org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151)\n\tat org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150)\n\tat org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:684)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252)\n\tat org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat java.base/java.lang.Thread.run(Thread.java:832)\n

```

In my case both the index and the alias exist. The ILM profile should roll over each index at max 20GB or 14 days but its failing with above error. Any suggestions on this is helpful.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 11, 2024, 2:32pm UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/2 "2024-09-11T14:32:43Z")

</div>

Hi @Rajeev_Aminbhavi Welcome to the comunity.

Mostly likely the Alias / Index was not set up properly.

What version of the stack are you using?

How did you initially setup up the template?

Are you using indices or data streams?

In kibana Dev Tools run the following show the command and results

`GET _alias/jaeger-span`

---

<div class="post-metadata">

**Author:** ![Rajeev\_Aminbhavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajeev_aminbhavi/32/137524_2.png) [@Rajeev\_Aminbhavi](https://discuss.elastic.co/u/Rajeev_Aminbhavi)\
**Post date:** [September 12, 2024, 4:24am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/3 "2024-09-12T04:24:08Z")

</div>

Hi @stephenb ,

My ES version is 7.10.2, integrating with Jaeger with version 1.57. Its a single node cluster.

Here are steps followed for template

```auto
curl -XPUT 'http://localhost:9200/_ilm/policy/jaeger_policy' -H 'Content-Type: application/json' -d '
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",  
        "actions": {
          "rollover": {
            "max_size": "20GB",  
            "max_age": "7d"
                
          }
        }
      },
      "delete": {
        "min_age": "15d",      
        "actions": {
          "delete": {}         
        }
      }
    }
  }
}'

```

```auto
 curl -XPUT 'http://localhost:9200/_template/jaeger_template' -H 'Content-Type: application/json' -d '
{
  "index_patterns": ["jaeger-span-*"],  
  "settings": {
    "number_of_shards": 1,               
    "number_of_replicas": 0,             
    "index.lifecycle.name": "jaeger_policy",  
    "index.lifecycle.rollover_alias": "jaeger-span" 
  }
}'

```

```auto
curl -XPOST 'http://localhost:9200/_aliases' -H 'Content-Type: application/json' -d '
{
  "actions": [
    {
      "add": {
        "index": "jaeger-span-*",
        "alias": "jaeger-span",
        "is_write_index": true
      }
    }
  ]
}'

```

Using indices.

Thanks,  
Rajeev

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 12, 2024, 4:38am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/4 "2024-09-12T04:38:13Z")

</div>

Hi @Rajeev_Aminbhavi

First, 7.10..2 is ancient. You are not going to get much help... you should really upgrade with a matter of urgency

Second you alias is not correct

as your error says...

```auto
index.lifecycle.rollover_alias [jaeger-span] does not point to index [jaeger-span-2024-08-02]

```

would need to be

```auto
        "index": "jaeger-span-2024-08-02",
        "alias": "jaeger-span",
        "is_write_index": true

```

This known as bootstraping and needs to be done in the beginning ...  
Then when `jaeger-span` a new alias should be created

```auto

```

```
    "index": "jaeger-span-2024-08-03",
    "alias": "jaeger-span",
    "is_write_index": true

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Rajeev\_Aminbhavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajeev_aminbhavi/32/137524_2.png) [@Rajeev\_Aminbhavi](https://discuss.elastic.co/u/Rajeev_Aminbhavi)\
**Post date:** [September 12, 2024, 4:38am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/5 "2024-09-12T04:38:27Z")

</div>

GET \_alias/jaeger-span

```auto
curl -XGET localhost:9200/_alias/jaeger-span?pretty
{
  "jaeger-span-2024-09-10" : {
    "aliases" : {
      "jaeger-span" : {
        "is_write_index" : true
      }
    }
  },
  "jaeger-span-2024-09-09" : {
    "aliases" : {
      "jaeger-span" : {
        "is_write_index" : false
      }
    }
  },
  "jaeger-span-2024-09-000010" : {
    "aliases" : {
      "jaeger-span" : {
        "is_write_index" : false
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Rajeev\_Aminbhavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajeev_aminbhavi/32/137524_2.png) [@Rajeev\_Aminbhavi](https://discuss.elastic.co/u/Rajeev_Aminbhavi)\
**Post date:** [September 12, 2024, 4:44am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/6 "2024-09-12T04:44:17Z")

</div>

@stephenb ,

Can i bootstrap again if so can you please point to correct steps.

Thanks,  
Rajeev

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 12, 2024, 6:12am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/7 "2024-09-12T06:12:47Z")

</div>

> [@Rajeev\_Aminbhavi](#):
>
> ```auto
> {
> "jaeger-span-2024-09-10" : {
> "aliases" : {
> "jaeger-span" : {
> "is_write_index" : true
> }
> }
> },
> 
> ```

This is the current write index.... you can only have one...

I am not really sure what state you are in. You look like you are trying to mix daily indices and ILM, which are similar concepts but not the same. I am not sure what is writing your data.

Your ILM policy says rollover on 7 days or 20 GB... but looks like whatever is writing your data is writing daily indices...

If you were to upgrade and use data streams this is all handled for you...

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 12, 2024, 6:17am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/8 "2024-09-12T06:17:10Z")

</div>

This is confusing...

> [@Rajeev\_Aminbhavi](#):
>
> ```auto
> "jaeger-span-2024-09-09" : { <<< This looks like Daily Index 
> "aliases" : {
> "jaeger-span" : {
> "is_write_index" : false
> }
> }
> },
> "jaeger-span-2024-09-000010" : { <<< THIS looks like ILM 
> "aliases" : {
> "jaeger-span" : {
> "is_write_index" : false
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![Rajeev\_Aminbhavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajeev_aminbhavi/32/137524_2.png) [@Rajeev\_Aminbhavi](https://discuss.elastic.co/u/Rajeev_Aminbhavi)\
**Post date:** [September 12, 2024, 6:30am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/9 "2024-09-12T06:30:53Z")

</div>

Is it possible to apply ILM for daily indices, yes as you mentioned data is getting written to daily indices. How can this be corrected, any guidance or suggestions.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 12, 2024, 6:32am UTC](https://discuss.elastic.co/t/getting-error-when-indices-getting-rollover-with-ilm-policy/366410/10 "2024-09-12T06:32:01Z")

</div>

Yes, you can use ILM with daily indices where the date is in the name but that means that you do not use rollover, which is currently part of your policy. You would then write to the indices directly and not have a write alias. In this scenarion ILM actions and transitions are based on the index creation timestamp rather than the rollover timestamp.
