Curator Reindex error


(James Peppercorn ) #1

I'm using painless in my reindex to create the new index name from xxxxx-yyyy.mm.dd to xxxxx-yyyy.mm.dd-ro, and I get the error that the post run quick check failed. I didn't know how to name the destination index without painless, but the dest.index: was required, so I put a made up value.

Am I over-complicating this by using painless? If not, any suggestions on how to fix this, please?

Curator v5.5.4
Elasticsearch v6.3.2

Log:

2018-10-04 00:28:13,199 INFO               curator.utils             task_check:1653 Task "reindex from [xim.ro.main.log-2018.10.03, xim.ro.uat.log-2018.10.03, xlm.dms.sta.winlog-2018.10.03, xim.ro.qa2.log-2018.10.03, xim.ro.qa.log-2018.10.03, xlm.dms.int.winlog-2018.10.03, xlm.dms.dev.log-2018.10.03, xlm.lmx.dev.ljk-2018.10.03, xlm.dms.int.log-2018.10.03, xlm.lmx.perf.ljk-2018.10.03, xlm.dms.sta.iis-2018.10.03, xlm.dms.sta.log-2018.10.03, xlm.lmx.sta.ljk-2018.10.03] updated with Script{type=inline, lang='painless', idOrCode='ctx._index = ctx._index + '-ro'', options={}, params={}} to [creatingreadonly]" completed at 2018-10-04T00:28:12Z.
2018-10-04 00:28:13,199 DEBUG              curator.utils            wait_for_it:1754 Response: True
2018-10-04 00:28:13,199 DEBUG              curator.utils            wait_for_it:1759 Action "reindex" finished executing (may or may not have been successful)
2018-10-04 00:28:13,199 DEBUG              curator.utils            wait_for_it:1777 Result: True
2018-10-04 00:28:13,205 ERROR     curator.actions.reindex  _post_run_quick_check:1291 The index described as "creatingreadonly" was not found after the reindex operation. Check Elasticsearch logs for more information.
2018-10-04 00:28:13,205 ERROR                curator.cli                    run:186  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 "creatingreadonly" was not found.

Curator action:

2:
  action: reindex
  description: "Perform a reindex on selected indices to change shards and replicas for readonly"
  options:
    timeout_override: 144000
    max_wait: 288000
    wait_interval: 30
    wait_for_completion: true
    ignore_empty_list: true
    continue_if_exception: false
    disable_action: false

    request_body:
      source:
        index: REINDEX_SELECTION
      dest:
        index: 'creatingreadonly'
      script:
        lang: painless
        source: ctx._index = ctx._index + '-ro'

  filters:

  - filtertype: pattern
    kind: regex
    value: '^[a-zA-Z].+[0-9]{4}.[0-9]{2}.[0-9]{2}$'
    exclude:

  - filtertype: period
    period_type: relative
    source: name
    range_from: -1
    range_to: -1
    timestring: '%Y.%m.%d'
    unit: days

(edit: added curator and elasticsearch version above)


(Aaron Mildenstein) #2

If you were using MIGRATION, I would have suggested using migration_suffix. But since you’re using REINDEX_SELECTION, then painless is the only easy way to rename each index.


(James Peppercorn ) #3

I would use MIGRATION if I could use some kind of wild card for the source index name, to get all of the indexes?

Since I am using REINDEX_SELECTION and painless, is there a way to prevent this error? If not, then I'll have to arrange the order of my "actions" to have this run last. Plus, I'm losing the Quick Check validation.


(Aaron Mildenstein) #4

:man_facepalming: My bad. My travel-worn, tired brain missed something big here, and that is that MIGRATION is not limited to remote reindex. In other words, you should be able to use MIGRATION in conjunction with REINDEX_SELECTION, no problem:

2:
  action: reindex
  description: "Perform a reindex on selected indices to change shards and replicas for readonly"
  options:
    timeout_override: 144000
    max_wait: 288000
    wait_interval: 30
    wait_for_completion: true
    ignore_empty_list: true
    migration_suffix: "-ro"
    request_body:
      source:
        index: REINDEX_SELECTION
      dest:
        index: MIGRATION
  filters:
  - filtertype: pattern
    kind: regex
    value: '^[a-zA-Z].+[0-9]{4}.[0-9]{2}.[0-9]{2}$'
    exclude:
  - filtertype: period
    period_type: relative
    source: name
    range_from: -1
    range_to: -1
    timestring: '%Y.%m.%d'
    unit: days

(James Peppercorn ) #5

Awesome, thanks!! I've made the changes for tonight and will confirm in the morning.


(James Peppercorn ) #6

@theuntergeek,

That did it, thanks!


(system) #7

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