Error using Curator 5.1.1 to restore snapshot

jenkins@592a48b3b882:~$ curator --config /tmp/config/es5-lineartv_dev.yml /tmp/actions/restore-lineartv_dev.yml
{"@timestamp": "2017-06-22T19:55:41.694Z", "function": "cli", "linenum": 153, "loglevel": "INFO", "message": "Preparing Action ID: 1, "restore"", "name": "curator.cli"}
Traceback (most recent call last):
File "/usr/local/bin/curator", line 9, in
load_entry_point('elasticsearch-curator==5.1.1', 'console_scripts', 'curator')()
File "/usr/local/lib/python2.7/dist-packages/click/", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/curator/", line 167, in cli
client = get_client(**client_args)
File "/usr/local/lib/python2.7/dist-packages/curator/", line 788, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: 'Session' object has no attribute 'merge_environment_settings'

How was Curator installed, on what platform?

It's a docker image, on Ubuntu 14.04.4, installed with pip:

RUN apt-get update && apt-get -y install python-pip python-dev && pip install elasticsearch-curator==5.1.1 requests-aws4auth

Hmmm. Please uninstall that from pip and try the bundled version from the APT Repository. There's also a direct download of the DEB package available.

I installed from deb package, now getting error about repository not found:
root@20dd6ee047da:/# curator --config /tmp/config/config.yml /tmp/actions/restore-snapshots-lineartv_dev.yml
{"@timestamp": "2017-06-23T19:01:30.217Z", "function": "cli", "linenum": 153, "loglevel": "INFO", "message": "Preparing Action ID: 1, "restore"", "name": "curator.cli"}
{"@timestamp": "2017-06-23T19:01:33.498Z", "function": "cli", "linenum": 174, "loglevel": "INFO", "message": "Trying Action ID: 1, "restore": restore airings-v7", "name": "curator.cli"}
{"@timestamp": "2017-06-23T19:01:34.536Z", "function": "cli", "linenum": 193, "loglevel": "ERROR", "message": "Failed to complete action: restore. <class 'curator.exceptions.FailedExecution'>: Unable to verify existence of repository [repository-name-redacted]", "name": "curator.cli"}

That message can mean that the repository was not created properly, or that it is not fully accessible. Each master and data node must have full read/write access to the same shared mount point path for fs type repositories ( in elasticsearch.yml). Or each master and data node must have read/write access to the same remote file share (s3, azure, hdfs). For these mount point types, this means that each master and data node has the appropriate repository plugin installed and properly configured.

If you're satisfied that these conditions are met, you can proceed with this test step.

What happens if you run:

$ curator_cli --config /tmp/config/config.yml show_snapshots --repository repository_name_redacted

This will log to the same place (or stdout), but will show all snapshots in the repository. If the same error persists, and you're certain that all of the above conditions have been met, let's talk again.

Looks like the error came about because I was trying to restore snapshots created on dev into test environment. If I use dev config, I do get a list of snapshots.

Seeing that result, wondering if it is possible to transfer index snapshots across environments. Or does that not even make sense? I guess it depends on what the search indices are collecting...

I'm also confused about setting up action files, in particular for filtering indices. Is there a way to snapshot all indices ? Currently my action file needs to specify indices by type, of which there are four for one cluster, and 1 for a different one.

It is not, as you have described it. The way to accomplish what you want, though, is to have the identical repository added to both clusters. Follow the steps to create the repository (including having the same mount points on both clusters) on both clusters, and then you will be able to snapshot in one, and restore to the other. Do not, under any circumstances, snapshot to the same repository from both clusters. This functionality should only ever be used to migrate data, or bring them into harmony. You should not snapshot from the target environment into the "source" environment's repository. You should have a separate repository for the target environment.

Yes. It's as simple as this:

- filtertype: none

This uses no filters, ensuring that all indices are selected.

Great, now I understand.

One more thing, why can I not run curator_cli to perform a snapshot-restore function? I see the list of commands available as:
allocation Shard Routing Allocation
close Close indices
delete_indices Delete indices
delete_snapshots Delete snapshots
forcemerge forceMerge index/shard segments
open Open indices
replicas Change replica count
show_indices Show indices
show_snapshots Show snapshots
snapshot Snapshot indices

There are a lot of complex options for the restore action. I did not want to add them all. If someone wants to submit a PR adding that functionality, and it looks good, then I'd probably merge it.

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