ES doesn't show list of snapshots

Hi,

I've had a server with ES 5.x. It was configured to make weekly snapshots and it worked fine.

One day, the server crashed, but I have all my snapshots available.

Today I'm trying to restore my indicies from the snapshot to the ES 5.5.0, but I've found the following strange behavior:

curl -XGET 'localhost:9200/_snapshot/my_backup/_status?pretty'
{
  "snapshots" : [ ]
}

So looks like there is no snapshots available, but if I query info for exact snapshot, it will show it:

curl -XGET 'localhost:9200/_snapshot/my_backup/snapshot_17/_status?pretty'
{
  "snapshots" : [
    {
      "snapshot" : "snapshot_17",
      "repository" : "my_backup",
      "uuid" : "AvAkoUytS-eQZr5MClc-yw",
      "state" : "SUCCESS",
      "shards_stats" : {
        "initializing" : 0,
        "started" : 0,
        "finalizing" : 0,
        "done" : 232,
        "failed" : 0,
        "total" : 232
      },
      "stats" : {
        "number_of_files" : 2152,
        "processed_files" : 2152,
        "total_size_in_bytes" : 20608012148,
        "processed_size_in_bytes" : 20608012148,
        "start_time_in_millis" : 1496880033727,
        "time_in_millis" : 1283497
      },
      "indices" : {
      ...
}

so why didn't the first command show the snapshot? (in fact there are snapshot_1 ... snapshot_17 available)

To list all snapshots you should use:

curl -XGET 'localhost:9200/_snapshot/my_backup/_all/_status?pretty`

I think when you requested:

curl -XGET 'localhost:9200/_snapshot/my_backup/_status?pretty'

Elasticsearch interpreted it as you wanting to find a snapshot named _status which is why you got 0 results.

According to the documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html

curl -XGET 'localhost:9200/_snapshot/my_backup/_status?pretty' must return information about all snapshots in the particular repository.

The paragraph above that command (sorry I didn't scroll down to there before, I was looking at the section titled Snapshot) says:

"In this format, the command will return information about all currently running snapshots"

By all currently running snapshots its referring to all snapshots that are currently in progress (as in the ones that are actually in the process of creating a snapshot). This is a bit confusing though so I'll make a change to update the documentation to clarify that.

I think in your case curl -XGET 'localhost:9200/_snapshot/my_backup/_all/_status?pretty should give you what you are after

Thanks for the explanation!

However, your suggested command doesn't work either:

curl -XGET 'localhost:9200/_snapshot/my_backup/_all/_status?pretty'
{
  "snapshots" : [ ]
}

Hmm actually the command I meant to write from the document was:

GET /_snapshot/my_backup/_all

but looking at this again it is actually weird and confusing that _snapshot/REPO/SNAPSHOT/_status does return a result but _snapshot/REPO/_all/_status doesn't. I'll try and investigate this a bit more. Bear with me.

That one works!

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