Schema error: extra keys not allowed @ data['action'] using curator for rollover api

action file

action: rollover
description: >-
Rollover the index associated with alias 'aliasname', which should be in the
form of prefix-YYYY.MM.DD-1.
options:
name: aliasname
new_indices: "<logstash-{now/d{YYYY.MM.dd|+12:00}}>"
conditions:
max_age: 1d
max_docs: 1000000
max_size: 5gb
extra_settings:
index.number_of_shards: 3
index.number_of_replicas: 1
timeout_override:
continue_if_exception: False
disable_action: False

Any one know what could be the reason of the error

Here is the detailed error

self.test_what, self.location, self.badvalue, self.error)

curator.exceptions.ConfigurationError: Configuration: Actions File: Location: root: Bad Value: "rollover", extra keys not allowed @ data['action']. Check configuration file.

Not sure what your action file actually looks like, as it's pasted without indents. To properly paste configuration files or snippets in Discuss, always encapsulate them between triple back ticks, like this:

```
PASTE HERE
```

I can tell you what this should look like, however:

---
actions:
  1:
    action: rollover
    description: >-
      Rollover the index associated with alias 'aliasname', which should be in the
      form of prefix-YYYY.MM.DD-1.
    options:
      name: aliasname
      new_indices: "<logstash-{now/d{YYYY.MM.dd|+12:00}}>"
      conditions:
        max_age: 1d
        max_docs: 1000000
        max_size: 5gb
      extra_settings:
        index.number_of_shards: 3
        index.number_of_replicas: 1
      timeout_override:
      continue_if_exception: False
      disable_action: False

Based on the error you posted, it appears that you are missing the portion at the top:

---
actions:
  1:

This is still part of the action file. The --- means you're telling the YAML interpreter to expect YAML. It's not strictly necessary, but does allow for comment lines to be used at the top of the file. actions: needs to be at the root level, completely unindented. And a numeric value, e.g. 1:, needs to be indented slightly from there, with the action block you added properly indented after that.

For an example of a Rollover action file, please see https://www.elastic.co/guide/en/elasticsearch/client/curator/current/ex_rollover.html

I am not sure why i am not be able to perform the rollover action using curator, whats wrong i am doing ?

34%20PM

root@de-elasticsearch-prince-one:/usr/local/bin# curator --config curator.yml rollover_indices.yml
2019-09-03 10:23:33,658 ERROR Schema error: extra keys not allowed @ data['new_indices']
Traceback (most recent call last):
File "/usr/local/bin/curator", line 11, in
sys.exit(cli())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/curator/cli.py", line 218, in cli
run(config, action_file, dry_run)
File "/usr/local/lib/python2.7/dist-packages/curator/cli.py", line 119, in run
action_dict = validate_actions(action_config)
File "/usr/local/lib/python2.7/dist-packages/curator/utils.py", line 1426, in validate_actions
loc
File "/usr/local/lib/python2.7/dist-packages/curator/validators/schemacheck.py", line 69, in result
self.test_what, self.location, self.badvalue, self.error)
curator.exceptions.ConfigurationError: Configuration: options: Location: Action ID "1", action "rollover": Bad Value: "<logstash-{now/d{YYYY.MM.dd|+12:00}}>", extra keys not allowed @ data['new_indices']. Check configuration file.

Can you please help why still it is not working...

I gave an express example of how to paste pre-formatted text, and you shared a screen shot. Please do not do this, as the screen shots are not copy/paste-able.

The error is clearly because new_indices is not valid. The option should be new_index, as you are only creating one index at rollover.

1 Like

Thanks for the help. but i think i cannot rollover an index based on the size without having a basic license

There is no such license restriction. The Rollover API does not require even a Basic license.

1 Like

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