# Empty snapshots

**URL:** <https://discuss.elastic.co/t/empty-snapshots/325194>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [February 9, 2023, 8:47pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194 "2023-02-09T20:47:55Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 9, 2023, 8:47pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/1 "2023-02-09T20:47:55Z")

</div>

Hi,

I have a problem when trying to create and restore a snapshot in Elasticsearch. The snapshots are blank.

**Some specifications:**

- I'm using a Mac (MacOS Monterey 12.6.2) if relevant. I'm running Elasticsearch in it and my idea is to generate snapshots in the same computer (for testing).
- Elasticsearch 8.6.0
- Kibana 8.6.0

**I followed these instructions:**

- [Register the repo](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-register-repository.html)
- [Create the snapshot](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-take-snapshot.html#automate-snapshots-slm) I'm creating it manually, without a SLM policy.
- [Restore the snapshot](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-restore-snapshot.html)

I configured the elasticsearch.yml file including the `path.repo:/Users/my_backups`

To register the snapshot repository I'm doing

```auto
curl -X PUT "localhost:9200/_snapshot/testing_backup?verify=true&pretty"
{
  "type": "fs",
  "settings": {
    "location": "testing_backup_location"
  }
}

# Receiving the response:
{
  "acknowledged" : true
}

```

To create the snapshot I'm using:

```auto
curl -X PUT "localhost:9200/_snapshot/testing_backup/testing_snapshot?wait_for_completion=true&pretty"
{
  "indices": "test_index"
}

```

Finally, when I checking the snapshots I get

```auto
curl -X GET localhost:9200/_snapshot/testing_backup/_current?pretty
{
  "snapshots" : [],
  "total" : 0,
  "remaining" : 0
}

# And
curl -X GET localhost:9200/_snapshot/_status?pretty
{
  "snapshots" : []
}

```

I tried recovering an index from a created snapshot. Using Kibana I observed that the index was created along its mapping but there was no information (size 0B also).

Any insights will be very appreciated.  
Best regards,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 9, 2023, 10:46pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/2 "2023-02-09T22:46:16Z")

</div>

> [@tmslara.a](#):
>
> To create the snapshot I'm using:

What is the response for that?

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 12:50pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/3 "2023-02-10T12:50:21Z")

</div>

```auto
{
  "snapshot" : {
    "snapshot" : "testing_snapshot",
    "uuid" : "PsrjsuGtQ16SnIamdY9FsA",
    "repository" : "testing_backup",
    "version_id" : 8060099,
    "version" : "8.6.0",
    "indices" : [
      ".geoip_databases",
      ".kibana_8.6.0_001",
      ".apm-agent-configuration",
      "test_index",
      ".kibana_task_manager_8.6.0_001",
      ".apm-custom-link"
    ],
    "data_streams" : [],
    "include_global_state" : true,
    "state" : "SUCCESS",
    "start_time" : "2023-02-09T20:38:12.132Z",
    "start_time_in_millis" : 1675975092132,
    "end_time" : "2023-02-09T20:38:18.638Z",
    "end_time_in_millis" : 1675975098638,
    "duration_in_millis" : 6506,
    "failures" : [],
    "shards" : {
      "total" : 6,
      "failed" : 0,
      "successful" : 6
    },
    "feature_states" : [
      {
        "feature_name" : "geoip",
        "indices" : [
          ".geoip_databases"
        ]
      },
      {
        "feature_name" : "kibana",
        "indices" : [
          ".apm-custom-link",
          ".kibana_8.6.0_001",
          ".apm-agent-configuration",
          ".kibana_task_manager_8.6.0_001"
        ]
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 3:08pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/4 "2023-02-10T15:08:36Z")

</div>

Can you also provide the output for `GET _snapshot/testing_backup/testing_snapshot` ?

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 3:14pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/5 "2023-02-10T15:14:44Z")

</div>

Sure. Here it is

```auto
{
  "snapshots" : [
    {
      "snapshot" : "testing_snapshot",
      "uuid" : "PsrjsuGtQ16SnIamdY9FsA",
      "repository" : "testing_backup",
      "version_id" : 8060099,
      "version" : "8.6.0",
      "indices" : [
        ".geoip_databases",
        ".kibana_8.6.0_001",
        ".apm-agent-configuration",
        "test_index",
        ".kibana_task_manager_8.6.0_001",
        ".apm-custom-link"
      ],
      "data_streams" : [],
      "include_global_state" : true,
      "state" : "SUCCESS",
      "start_time" : "2023-02-09T20:38:12.132Z",
      "start_time_in_millis" : 1675975092132,
      "end_time" : "2023-02-09T20:38:18.638Z",
      "end_time_in_millis" : 1675975098638,
      "duration_in_millis" : 6506,
      "failures" : [],
      "shards" : {
        "total" : 6,
        "failed" : 0,
        "successful" : 6
      },
      "feature_states" : [
        {
          "feature_name" : "geoip",
          "indices" : [
            ".geoip_databases"
          ]
        },
        {
          "feature_name" : "kibana",
          "indices" : [
            ".apm-custom-link",
            ".kibana_8.6.0_001",
            ".apm-agent-configuration",
            ".kibana_task_manager_8.6.0_001"
          ]
        }
      ]
    }
  ],
  "total" : 1,
  "remaining" : 0
}

```

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 3:59pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/6 "2023-02-10T15:59:56Z")

</div>

Ok, so the snapshot was successful and your `test_index` is present. When the snapshot was taken, did you have any documents stored in it ?  
Can you please try

```auto
POST _snapshot/testing_backup/testing_snapshot/_restore
{
  "indices": "test_index"
}

```

followed by `GET _cat/indices/test_index?v` and provide the output ?

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 4:23pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/7 "2023-02-10T16:23:58Z")

</div>

> [@Ayush\_Mathur](#):
>
> Ok, so the snapshot was successful and your `test_index` is present. When the snapshot was taken, did you have any documents stored in it ?

Yes, if before creating the snapshot I do

```auto
curl -X GET "localhost:9200/_cat/indices/test_index?v&pretty"

# I receive 
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open test_index B-j4fJQCR5qYafsh01yaQg 1 1 2010722 0 183.9mb 183.9mb

```

> [@Ayush\_Mathur](#):
>
> Can you please try

Mmm, but this will try to restore the test\_index, which already exists. Is it OK? In my previous attempts I tried deleting the index and then restoring it, as described in [Restore the snapshot](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-restore-snapshot.html#delete-restore)

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 4:28pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/8 "2023-02-10T16:28:32Z")

</div>

Ahh right, may be try like this then:

```auto
POST _snapshot/testing_backup/testing_snapshot/_restore
{
  "indices": "test_index",
  "rename_pattern": "(.+)",
  "rename_replacement": "restored-$1"
}

```

followed by `GET _cat/indices/restored*?v`

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 10, 2023, 4:55pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/9 "2023-02-10T16:55:51Z")

</div>

> [@tmslara.a](#):
>
> ```auto
> curl -X GET localhost:9200/_snapshot/testing_backup/_current?pretty
> {
> "snapshots" : [],
> "total" : 0,
> "remaining" : 0
> }
> 
> ```

`GET _snapshot/$REPO/_current` only shows the currently-running snapshots, so it will return an empty list if the snapshot completed. You want `GET _snapshot/$REPO/_all`.

> [@tmslara.a](#):
>
> ```auto
> # And
> curl -X GET localhost:9200/_snapshot/_status?pretty
> {
> "snapshots" : []
> }
> 
> ```

Similarly, `GET _snapshot/_status` only returns the status of currently-running snapshots.

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 5:22pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/10 "2023-02-10T17:22:42Z")

</div>

> [@Ayush\_Mathur](#):
>
> ```auto
> POST _snapshot/testing_backup/testing_snapshot/_restore
> {
> "indices": "test_index",
> "rename_pattern": "(.+)",
> "rename_replacement": "restored-$1"
> }
> 
> ```

I got

```auto
{"accepted":true}

```

> [@Ayush\_Mathur](#):
>
> followed by `GET _cat/indices/restored*?v`

I got

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
red open restored-test_index 16WPI_uGQRavBQ8VZqV0sQ 1 1  

```

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 5:25pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/11 "2023-02-10T17:25:29Z")

</div>

> [@DavidTurner](#):
>
> `GET _snapshot/$REPO/_all`.

I got the same information that I received using

```auto
GET _snapshot/testing_backup/testing_snapshot

```

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 5:37pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/12 "2023-02-10T17:37:39Z")

</div>

OK, wait for some time, the index needs to be green first before data can be restored to it. The restoration can take some time since restoration speed will depend on your network bandwidth and repository configuration.

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 5:47pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/13 "2023-02-10T17:47:40Z")

</div>

test\_index, the index that I'm trying to get the snapshot from, is yellow. Is it relevant?

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 6:10pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/14 "2023-02-10T18:10:25Z")

</div>

@DavidTurner I guess this shouldn't be an issue right ? Essentially the primary shard is available to take snapshot from.  
@tmslara.a is your `restored-test_index` also yellow or is it still red ? If red, can you please check `GET _cat/shards/restored*?v&h=name,status` and `GET _cluster/allocation/explain` to get details on why the shard is not being initialized ?

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 6:30pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/15 "2023-02-10T18:30:41Z")

</div>

> [@Ayush\_Mathur](#):
>
> GET \_cat/shards/restored\*?v&h=name,status

This is empty, I don't receive anything back.

> [@Ayush\_Mathur](#):
>
> `GET _cluster/allocation/explain`

I got

```auto
{
  "note" : "No shard was specified in the explain API request, so this response explains a randomly chosen unassigned shard. There may be other unassigned shards in this cluster which cannot be assigned for different reasons. It may not be possible to assign this shard until one of the other shards is assigned correctly. To explain the allocation of other shards (whether assigned or unassigned) you must specify the target shard in the request to this API.",
  "index" : "restored-test_index",
  "shard" : 0,
  "primary" : true,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "NEW_INDEX_RESTORED",
    "at" : "2023-02-10T17:19:11.263Z",
    "details" : "restore_source[testing_backup/testing_snapshot]",
    "last_allocation_status" : "no"
  },
  "can_allocate" : "no",
  "allocate_explanation" : "Elasticsearch isn't allowed to allocate this shard to any of the nodes in the cluster. Choose a node to which you expect this shard to be allocated, find this node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from allocating this shard there.",
  "node_allocation_decisions" : [
    {
      "node_id" : "LWcDogKwQ7u0GPRogQHUEA",
      "node_name" : "Tomass-MacBook-Pro.local",
      "transport_address" : "127.0.0.1:9300",
      "node_attributes" : {
        "ml.machine_memory" : "8589934592",
        "xpack.installed" : "true",
        "ml.allocated_processors_double" : "4.0",
        "ml.max_jvm_size" : "4294967296",
        "ml.allocated_processors" : "4"
      },
      "node_decision" : "no",
      "weight_ranking" : 1,
      "deciders" : [
        {
          "decider" : "restore_in_progress",
          "decision" : "NO",
          "explanation" : "shard has failed to be restored from the snapshot [testing_backup:testing_snapshot/iU6x5kj5S9CgkrBLcO6Plw] - manually close or delete the index [restored-test_index] in order to retry to restore the snapshot again or use the reroute API to force the allocation of an empty primary shard. Details: [restore_source[testing_backup/testing_snapshot]]"
        }
      ]
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 10, 2023, 6:34pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/16 "2023-02-10T18:34:42Z")

</div>

> [@Ayush\_Mathur](#):
>
> @DavidTurner I guess this shouldn't be an issue right ? Essentially the primary shard is available to take snapshot from.

I think the yellow status is normal since I'm doing everything in a single node (my PC).

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [February 10, 2023, 6:54pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/17 "2023-02-10T18:54:52Z")

</div>

> [@tmslara.a](#):
>
> `"decider" : "restore_in_progress"`

Guess we need to wait for this task to be completed first.

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [February 13, 2023, 7:46pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/18 "2023-02-13T19:46:42Z")

</div>

Everything still the same

---

<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:** [March 13, 2023, 7:46pm UTC](https://discuss.elastic.co/t/empty-snapshots/325194/19 "2023-03-13T19:46:51Z")

</div>

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