Elasticsearch-curator 5.8.2 is failing during TypeError: load() missing 1 required positional argument: 'Loader'


I'm trying to execute a dry run for delete snapshot when I got this error: TypeError: load() missing 1 required positional argument: 'Loader'

Note that it worked before (like 5 days ago). It started failing after we upgraded our production system PyYAML to 6. Is there a curator version that works with PyYAML 6 (AND it should also work with Elasticsearch 5.6.17)?
Will really appreciate your help!

Thank you!


[ec2-user@ip-00-00-00 elastic_backup]$ curator --config ./curator.yaml --dry-run delete_snapshots.yaml
Traceback (most recent call last):
  File "/home/ec2-user/.local/bin/curator", line 11, in <module>
  File "/home/ec2-user/.local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/curator/cli.py", line 243, in cli
    run(config, action_file, dry_run)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/curator/cli.py", line 110, in run
    client_args = process_config(config)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/curator/config_utils.py", line 43, in process_config
    config = test_config(yaml_file)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/curator/config_utils.py", line 12, in test_config
    yaml_config = get_yaml(config)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/curator/utils.py", line 59, in get_yaml
    return yaml.load(read_file(path))
TypeError: load() missing 1 required positional argument: 'Loader'

Self diagnosis:

  1. I came accross this issue: Delete_snapshot action fails, get() takes at least 2 arguments (2 given)
    but I don't see any resolution? forgive me if I have missed it somewhere?

  2. some sites are suggesting that I should downgrade my pyyaml to 5.x.x BUT I cannot do that as that is going to break our production environment.

Software information:

  "name" : "_BwkrrP",
  "cluster_name" : "<OMITTED>:test-5",
  "cluster_uuid" : "l0h6_<OMITTED>",
  "version" : {
    "number" : "5.6.17",
    "build_hash" : "59bb0dc",
    "build_date" : "2020-01-03T11:28:23.851Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  "tagline" : "You Know, for Search"

pip3.6 list

elasticsearch-curator 5.8.2
PyYAML                6.0

You have a few options.

  1. Run Curator in a Python virtualenv. This will allow it to manage its own dependencies outside of the system defaults.
  2. Run Curator from a different machine or VM
  3. Find the old 5.8.2 RPM or DEB package and install that, as it is standalone and requires no system python to even run.

There are probably other variations that would work, but these are the lowest hanging fruit.

Thank you for your response! I chose to run it in Python virtualenv, and it worked there. Thanks again.

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