# Curator Reindex

**URL:** https://discuss.elastic.co/t/curator-reindex/124328
**Category:** Elasticsearch
**Created:** [March 16, 2018, 4:23pm UTC](https://discuss.elastic.co/t/curator-reindex/124328 "2018-03-16T16:23:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Ben96](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben96/32/28334_2.png) [@Ben96](https://discuss.elastic.co/u/Ben96)
#### Post date: [March 16, 2018, 4:23pm UTC](https://discuss.elastic.co/t/curator-reindex/124328/1 "2018-03-16T16:23:07Z")

</div>

Hi Everyone,

Today i wanted to manage my reindex from daily indices to monthly with Curator.

The thing is i encoutered a error and i can't debug it, waste a bit time on google to find some help but nothing.

Here Action.yml

```
---
#################################
#
# Curator - Reindex Daily To Monthly
#
#################################

# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.

actions:
  1:
    action: reindex
    description: Curator - Reindex Daily To Monthly
    options:
      max_wait: -1
      wait_interval: 10
      wait_for_completion: True
      ignore_empty_list: False
      continue_if_exception: False
      disable_action: False
      request_body:
        source:
          index: REINDEX_SELECTION
        dest:
          index: 'toto-reindex'
    filters:
    - filtertype: pattern
      kind: prefix
      value: toto-2018.03.
# End of Curator - Reindex Daily To Monthly

```

And the return when executing :

> 2018-03-16 17:12:17,487 ERROR curator.actions.reindex \_post\_run\_quick\_check:1266 The index described as "toto-reindex" was not found after the reindex operation. Check Elasticsearch logs for more information.  
> 2018-03-16 17:12:17,487 ERROR curator.cli run:184 Failed to complete action: reindex. \<class 'curator.exceptions.FailedExecution'\>: Exception encountered. Rerun with loglevel DEBUG and/or check Elasticsearch logs for more information. Exception: Reindex failed. The index or alias identified by "toto-reindex" was not found.

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [March 18, 2018, 3:16pm UTC](https://discuss.elastic.co/t/curator-reindex/124328/2 "2018-03-18T15:16:29Z")

</div>

I am not really sure if Curator can do such operation. Maybe @theuntergeek could clarify here.

But another way to do what you want is to call the Reindex API directly with a proper script. The following following can be used as a base script to work on [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#\_reindex\_daily\_indices](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#_reindex_daily_indices)

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 18, 2018, 5:07pm UTC](https://discuss.elastic.co/t/curator-reindex/124328/3 "2018-03-18T17:07:47Z")

</div>

Is dynamic index creation disabled in your cluster? This would definitely be the result if that were the case. Elasticsearch would also have logs explaining what happened with your reindex.

The error you're getting from Curator is simply telling you that Curator attempted to perform the action, and something happened. Curator does a sanity check after the reindex to make sure the index is at least present. It isn't, so Curator is raising the red flag here. I would like to see the Curator log messages preceding the error lines you shared. There may be more information to be obtained within those lines.

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 18, 2018, 5:27pm UTC](https://discuss.elastic.co/t/curator-reindex/124328/4 "2018-03-18T17:27:13Z")

</div>

> [@thiago](#):
>
> I am not really sure if Curator can do such operation.

Yes, it can, and a whole lot more. See the [`request_body`](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_request_body.html) documentation.

---

<div class="post-metadata">

### Author: ![Ben96](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben96/32/28334_2.png) [@Ben96](https://discuss.elastic.co/u/Ben96)
#### Post date: [March 19, 2018, 7:29am UTC](https://discuss.elastic.co/t/curator-reindex/124328/5 "2018-03-19T07:29:11Z")

</div>

Hi dudes, thanks for replying. @theuntergeek & @thiago

Here lines before those i already put in the post : (Not the same date)

```
moving from list.
2018-03-19 08:22:37,617 DEBUG curator.utils iterate_filters:1087 Post-instance: ['toto-2018.03.19', 'toto-2018.03.20']
2018-03-19 08:22:37,617 DEBUG curator.actions.reindex __init__ :1055 REQUEST_BODY = {'source': {'index': 'REINDEX_SELECTION'}, 'dest': {'index': 'toto-reindex'}}
2018-03-19 08:22:37,617 DEBUG curator.actions.reindex __init__ :1228 Reindexing indices: ['toto-2018.03.19', 'toto-2018.03.20']
2018-03-19 08:22:37,617 DEBUG curator.cli process_action:99 Doing the action here.
2018-03-19 08:22:37,617 INFO curator.actions.reindex do_action:1335 Commencing reindex operation
2018-03-19 08:22:37,617 DEBUG curator.actions.reindex do_action:1337 REINDEX: request body: {'source': {'index': ['toto-2018.03.19', 'toto-2018.03.20']}, 'dest': {'index': 'toto-reindex'}} with arguments: refresh=True requests_per_second=-1 slices=1 timeout=60s wait_for_active_shards=1 wait_for_completion=True
2018-03-19 08:22:37,622 DEBUG curator.actions.reindex do_action:1341 TASK ID = COAvg19PRzmJS-VVcpZTag:25857014
2018-03-19 08:22:37,623 DEBUG curator.utils wait_for_it:1725 Elapsed time: 0 seconds
2018-03-19 08:22:37,625 DEBUG curator.utils task_check:1623 running_time_in_nanos = 0.0038247050000000003
2018-03-19 08:22:37,625 DEBUG curator.utils task_check:1635 Full Task Data: {'completed': False, 'task': {'node': 'COAvg19PRzmJS-VVcpZTag', 'id': 25857014, 'type': 'transport', 'action': 'indices:data/write/reindex', 'status': {'total': 0, 'updated': 0, 'created': 0, 'deleted': 0, 'batches': 0, 'version_conflicts': 0, 'noops': 0, 'retries': {'bulk': 0, 'search': 0}, 'throttled_millis': 0, 'requests_per_second': -1.0, 'throttled_until_millis': 0}, 'description': 'reindex from [toto-2018.03.19, toto-2018.03.20] to [toto-reindex]', 'start_time_in_millis': 1521444157620, 'running_time_in_nanos': 3824705, 'cancellable': True}}
2018-03-19 08:22:37,625 INFO curator.utils task_check:1638 Task "reindex from [toto-2018.03.19, toto-2018.03.20] to [toto-reindex]" with task_id "COAvg19PRzmJS-VVcpZTag:25857014" has been running for 0.0038247050000000003 seconds
2018-03-19 08:22:37,625 DEBUG curator.utils wait_for_it:1728 Response: False
2018-03-19 08:22:37,625 DEBUG curator.utils wait_for_it:1748 Action "reindex" not yet complete, 0 total seconds elapsed. Waiting 10 seconds before checking again.
2018-03-19 08:22:47,633 DEBUG curator.utils wait_for_it:1725 Elapsed time: 10 seconds
2018-03-19 08:22:47,637 DEBUG curator.utils task_check:1623 running_time_in_nanos = 0.0050319530000000005
2018-03-19 08:22:47,637 INFO curator.utils task_check:1631 Task "reindex from [toto-2018.03.19, toto-2018.03.20] to [toto-reindex]" completed at 2018-03-19T08:22:37Z.
2018-03-19 08:22:47,637 DEBUG curator.utils wait_for_it:1728 Response: True
2018-03-19 08:22:47,637 DEBUG curator.utils wait_for_it:1733 Action "reindex" finished executing (may or may not have been successful)
2018-03-19 08:22:47,637 DEBUG curator.utils wait_for_it:1751 Result: True

```

Logs after filter part (filters are too long for the topic and useless i think)

So i hope this can help you to resolve my issue with me.

Edit: When adding action create index it seems work fine, so it could solve my issue.

Edit 2 : Does Curator Reindex action support Date Math in Dest/Source ?  
-\> Creating index with dath math and reindex with same date math for example

Edit 3 : All done

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 19, 2018, 5:15pm UTC](https://discuss.elastic.co/t/curator-reindex/124328/6 "2018-03-19T17:15:38Z")

</div>

You marked it "solved." Is it solved?

I can tell you that the task says it completed pretty much instantaneously:

```auto
2018-03-19 08:22:37,617 INFO curator.actions.reindex do_action:1335 Commencing reindex operation
...
2018-03-19 08:22:47,637 INFO curator.utils task_check:1631 Task "reindex from [toto-2018.03.19, toto-2018.03.20] to [toto-reindex]" completed at 2018-03-19T08:22:37Z.

```

It made you wait 10 seconds, just to be sure (mostly so the Tasks API has a chance to spool up and actually register the Reindex "task"), but it says it completed at exactly the moment it started. The only way that happens is if the indices basically had one or two docs is all, or there's something else wrong on the Elasticsearch side. Let me run through the program flow a bit.

After selecting the indices you want reindexed, all Curator does is initiate the Reindex API call. This creates a "task" which is viewable in the Tasks API. Curator monitors the Tasks API for completion of the Reindex task it initiated. When it gets the "completed" response back from the Tasks API, it checks to see if the index you set for `dest` is, in fact, created (Curator does no size or doc count checking). But that's what Curator does. The problem for you seems to be on the Elasticsearch side. Why do I suggest this? Because you'd have a similar problem if you made the exact same API calls yourself, manually.

Your next step is to look through the Elasticsearch logs (particularly the master nodes, and/or the node that Curator is connecting to) at around `2018-03-19 08:22:37,617` to see what is going on in Elasticsearch, since Curator is doing what it is supposed to do.

You may also be able to dig up some information on task `COAvg19PRzmJS-VVcpZTag:25857014` (which is the node the task ran on, a colon, and the id number assigned for the task) to see what the result was. Curator only checked to see if the task completed.

---

<div class="post-metadata">

### Author: ![Ben96](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben96/32/28334_2.png) [@Ben96](https://discuss.elastic.co/u/Ben96)
#### Post date: [March 20, 2018, 7:20am UTC](https://discuss.elastic.co/t/curator-reindex/124328/7 "2018-03-20T07:20:39Z")

</div>

Yeah i marked it solved, because i found a alternativ to my issue (Creating the reindex index in my action file)

Yes indeed, when i ran reindex manually got the same error

Maybe it could be those empty index that i created to test curator reindex ?

I will check out logs to see if somethings wrong

---

<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: [April 17, 2018, 7:20am UTC](https://discuss.elastic.co/t/curator-reindex/124328/8 "2018-04-17T07:20:49Z")

</div>

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