# Policy is not getting applied to the particular index in elastic

**URL:** <https://discuss.elastic.co/t/policy-is-not-getting-applied-to-the-particular-index-in-elastic/316399>\
**Category:** Elasticsearch\
**Created:** [October 12, 2022, 6:39am UTC](https://discuss.elastic.co/t/policy-is-not-getting-applied-to-the-particular-index-in-elastic/316399 "2022-10-12T06:39:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnandRajalingam](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@AnandRajalingam](https://discuss.elastic.co/u/AnandRajalingam)\
**Post date:** [October 12, 2022, 6:39am UTC](https://discuss.elastic.co/t/policy-is-not-getting-applied-to-the-particular-index-in-elastic/316399/1 "2022-10-12T06:39:08Z")

</div>

We have upgraded our elastic from 6.xxx to 7.17.15 version recently. Our elastic policy was working fine in the old instances but not working in the new server.

Please find below steps which are performed while creating index.

1. Created the Policy through Kibana.

```auto
 hot phase: 
             rollover : {
              maxsize: 50gb
             },
       Delete Phase:
          min age: 120d

```

this is just information of policy and not the complete policy details.  
2) Created the template .  
3) Created index and then reindex using below query.

```auto
  PUT /index-xxxx01

  POST _aliases
         {
        "actions": [
                   {
                                  "add": {
                                                "index": "Index-name-xxxx01",
                                                "alias": "aliasName",
                                                "routing": "rountingalias"
                                  }
                                }
                  ]
                }

```

1. One index is created in new server, used below query to get the data from old server.

```auto
 POST _reindex
                {
                  "source": {
                                "remote": {
                                  "host": https://oldInstancehostName:9200,
                                  "username": " ********",
                                  "password": " ********"
                                },
                                "index": "oldindexInstanceName-xxxx16"
                  },
                  "dest": {
                                "index": "index-name-xxxx01"
                  }
                }

```

But getting below errors in the console.

[2022-10-07T00:01:54,057][INFO][o.e.x.i.IndexLifecycleRunner] [hostname] policy **[policy-name] for index [index-name-xxxx01] on an error step due to a transient error, moving back to the failed step [check-rollover-ready] for execution. retry attempt [282]**  
**[2022-10-07T00:11:54,057][ERROR][o.e.x.i.IndexLifecycleRunner] [hostname] policy [transaction-fisb-policy] for index [index-name-xxxx01] failed on step [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}]. Moving to ERROR step**  
**java.lang.IllegalArgumentException: rollover target [index-name] does not point to a write index**  
at org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService.validate(MetadataRolloverService.java:473) ~[elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService.resolveRolloverNames(MetadataRolloverService.java:158) ~[elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction.lambda$masterOperation$1(TransportRolloverAction.java:135) ~[elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:88) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:82) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:31) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.lambda$applyInternal$2(SecurityActionFilter.java:192) [x-pack-security-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.ActionListener$DelegatingFailureActionListener.onResponse(ActionListener.java:219) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$AsyncAction.onCompletion(TransportBroadcastByNodeAction.java:419) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$AsyncAction.onNodeResponse(TransportBroadcastByNodeAction.java:386) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$AsyncAction$1.handleResponse(TransportBroadcastByNodeAction.java:362) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$AsyncAction$1.handleResponse(TransportBroadcastByNodeAction.java:354) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.transport.TransportService$4.handleResponse(TransportService.java:847) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1471) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.transport.TransportService$DirectResponseChannel.processResponse(TransportService.java:1549) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1529) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:41) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$BroadcastByNodeTransportRequestHandler.finishHim(TransportBroadcastByNodeAction.java:489) [elasticsearch-7.17.5.jar:7.17.5]  
at org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction$BroadcastByNodeTransportRequestHandler.access$1100(TransportBroadcastByNodeAction.java:427) [elasticsearch-7.17.5.jar:7.17.5]

Thank you in advance.

---

<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:** [November 9, 2022, 6:39am UTC](https://discuss.elastic.co/t/policy-is-not-getting-applied-to-the-particular-index-in-elastic/316399/2 "2022-11-09T06:39:19Z")

</div>

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