# \[Solved\]Elasticsearch curator delete error?

**URL:** <https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086>\
**Category:** Elasticsearch\
**Created:** [March 27, 2017, 8:03am UTC](https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086 "2017-03-27T08:03:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 27, 2017, 8:03am UTC](https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086/1 "2017-03-27T08:03:05Z")

</div>

HI,

curator 4.2.6

```
Action file
---
# 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: delete_indices
    description: >-
      Delete indices older than 45 days (based on index name), for logstash-
      prefixed indices. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 1
      exclude:

```

When i executed the action file in curator i got an error like this:

```
hero@5684:~/.curator$ curator --dry-run --config curator.yml delete.yml
Traceback (most recent call last):
  File "/usr/local/bin/curator", line 9, in <module>
    load_entry_point('elasticsearch-curator==4.2.6', 'console_scripts', 'curator')()
  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 125, in cli
    action_config = get_yaml(action_file)
  File "/usr/local/lib/python2.7/dist-packages/curator/utils.py", line 53, in get_yaml
    cfg = yaml.load(raw)
  File "/usr/lib/python2.7/dist-packages/yaml/ __init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 39, in get_single_node
    if not self.check_event(StreamEndEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 7, column 1:
    actions:
    ^

```

May i know why i got this error?

I also tried it by giving  
`hero@5684:~/.curator$ curator --dry-run --config ~/.curator/curator.yml ~/.curator/delete.yml`

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [March 27, 2017, 12:07pm UTC](https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086/2 "2017-03-27T12:07:50Z")

</div>

Sorry, i didn't closed the comment with # in config file. so that's error ..

i used the command like this  
`hero@5684:~/.curator$ curator --dry-run --config curator.yml delete.yml`

---

<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 27, 2017, 3:56pm UTC](https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086/3 "2017-03-27T15:56:42Z")

</div>

A YAML file must start with `---` or the first block mapping element.

```auto
Action file
---
# 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:

```

The error here is that the words `Action file` seem to be at the beginning of your file, instead of `---` or `actions:`.

Either of those is acceptable, so your action file might begin like:

```auto
---
actions:
  1:
    action: delete_indices
    # everything else as constituted...

```

---

<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 24, 2017, 3:57pm UTC](https://discuss.elastic.co/t/solved-elasticsearch-curator-delete-error/80086/4 "2017-04-24T15:57:01Z")

</div>

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