Curator: YAML Lint fails silently

Created on 20 Jun 2018  路  3Comments  路  Source: elastic/curator

Expected Behavior

If there is a syntax error in the YAML, it should throw an error rather than exiting silently.

Actual Behavior

In some situations, curator runs and exits without any output if supplied with a configuration in which there is a YAML syntax error.

Steps to Reproduce the Problem

  1. Install elasticsearch-curator-5.5.4-1.x86_64.rpm on an offline RHEL 7.4 (Maipo) machine
  2. Run with a yaml file with a syntax error, e.g.:
client:
  hosts: ["10.10.10.10"]
  port: 9200
  use_ssl: True
  certificate:'/etc/elasticsearch/ca.crt'

(Note the minor syntax error here: there should be a space after the : on the certificate line)

  1. When curator is run (saving the config in ~/.curator/curator.yml, it will return
curator_cli show_indices --loglevel DEBUG
or
curator --config ~/.curator/curator.yml --dry-run ./shrink.yml

It simply exits without any output to log or console.

Note that this seems to be related to the installation method - on a similar pip install the issue does not manifest.

bug

Most helpful comment

Using the exact example above, the soon-to-be-updated code will yield:

$ python run_curator.py --config badyaml.yml action.yml
Unable to read/parse YAML file: badyaml.yml
while scanning a simple key
  in "<unicode string>", line 5, column 3:
      certificate:'/etc/elasticsearch/ ...
      ^
could not find expected ':'
  in "<unicode string>", line 6, column 1:

    ^

and immediately terminate with an exit code of 1

All 3 comments

I've reproduced this by building the Dockerfile from the v5.5.4 tag

Using the exact example above, the soon-to-be-updated code will yield:

$ python run_curator.py --config badyaml.yml action.yml
Unable to read/parse YAML file: badyaml.yml
while scanning a simple key
  in "<unicode string>", line 5, column 3:
      certificate:'/etc/elasticsearch/ ...
      ^
could not find expected ':'
  in "<unicode string>", line 6, column 1:

    ^

and immediately terminate with an exit code of 1

Thank you @untergeek ! :)

Was this page helpful?
0 / 5 - 0 ratings