Error: Invalid snapshot name snapshot with the same name already in-progress

Hello dear friends I have a problem.
I want to store an index that is in elasticsearch. I created a new repository for this and this repository does not have any snapshots. But when I ran the code blog below, it returned me the error message "Invalid snapshot name snapshot with the same name already in-progress " how can I fix this problem please help me.

I created a new repository with the following code block:

PUT /_snapshot/backup_repository
{
  "type": "fs",
  "settings": {
    "compress" : "true",
    "location": "C:/backups/backup_my_index"
  }
}

just to be sure i used the code block below and the query returned me this result:

GET /_snapshot/backup_repository/_status

result:
{
  "snapshots" : [ ]
}

I wanted to make a backup with the following code block:

PUT /_snapshot/backup_repository/my_snapshot?wait_for_completion=true
{
  "indices": "my_index",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "busra duygu",
    "taken_because": "backup for my_index"
  }
}

Error :

{
  "error" : {
    "root_cause" : [
      {
        "type" : "invalid_snapshot_name_exception",
        "reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
      }
    ],
    "type" : "invalid_snapshot_name_exception",
    "reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
  },
  "status" : 400
}

I would be very happy if you could help me... :slight_smile:

What's the output from GET /_snapshot/_status?

@warkolm this query returned me the following result:

{
  "snapshots" : [ ]
}

Did you set the repo.path in your elasticsearch.yml?

Note the syntax...

path:
  repo:
    - "E:\\Mount\\Backups"    

See here:

@stephenb Yes, this is recorded in my elasticsearch.yml file.
Exactly like this :
path.repo: C:/backups

Well the syntax example is

path:
  repo:
    - "E:\\Mount\\Backups

So perhaps yours should be

path:
  repo:
    - "C:\\backups

Back slashes....

I tried that too but I still get the same error. The number of documents in the index I want to backup is very high, there are one and a half billion documents, and it is important for me to take a backup of this index.but I could not solve this error, I tried to create a new repository many times. Even though there are no snapshots in the repositories, the snapshot with the same name already exists.

What happens when you try a snapshot with a different name?

Also I've seen errors like this when the permissions for that directory Do not let the same user that's running elastic write to that directory so make sure the permissions are correct.

It gave the same error when I created a snapshot with a different name. Could it be something with ram?

Probably not, why would you guess that, what size server is this on?

Lets go through this step by step.

First per the docs all All windows paths should be of the following form see the docks here

Let's walk through this.

In the Elasticsearch.yml note the " and everything... did you put the Quotes in? For Windows paths you must user \\ there is no "maybe" on this :slight_smile:

Also make sure that directory has read / write privileges for the same use that runs elasticsearch.

path:
  repo:
    - "C:\\backups"

Restart Elasticsearch

Go to Kibana Dev Tools
This command will report on all repositories

GET _snapshot

if there are any repositories delete them with

DELETE _snapshot/repository_name

Then create your repository

PUT /_snapshot/backup_repository
{
  "type": "fs",
  "settings": {
    "compress" : "true",
    "location": "C:\\backups\\backup_my_index"
  }
}

Then let's check the status of the repository you have not done that yet see what we get.

GET /_snapshot/backup_repository

You should see something like

{
  "backup_repository" : {
    "type" : "fs",
    "settings" : {
      "compress" : "true",
      "location" : "C:\\backups\\backup_my_index"
    }
  }
}

Did you get this response correctly? Report back.

If this all works then we will move onto the actual snapshot.

(BTW I just followed these steps and they all worked for me)

After when you actually create a snapshot it should look like this

PUT /_snapshot/backup_repository/my_snapshot?wait_for_completion=true
{
  "indices": "*",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "busra duygu",
    "taken_because": "backup for my_index"
  }
}

You should get a response like

{
  "snapshot" : {
    "snapshot" : "my_snapshot",
    "uuid" : "FXCxOen3RLWigsEPqMsUEg",
    "repository" : "backup_repository",
    "version_id" : 7140199,
    "version" : "7.14.1",
    "indices" : [
      ".geoip_databases",
      ".kibana-event-log-7.14.1-000001",
      ".ds-ilm-history-5-2021.09.17-000001",
      "discuss-test",
      ".apm-agent-configuration",
      ".kibana_7.14.1_001",
      ".apm-custom-link",
      ".kibana_task_manager_7.14.1_001"
    ],
    "data_streams" : [
      "ilm-history-5"
    ],
    "include_global_state" : false,
    "metadata" : {
      "taken_by" : "busra duygu",
      "taken_because" : "backup for my_index"
    },
    "state" : "SUCCESS",
    "start_time" : "2021-09-17T15:11:38.560Z",
    "start_time_in_millis" : 1631891498560,
    "end_time" : "2021-09-17T15:11:39.984Z",
    "end_time_in_millis" : 1631891499984,
    "duration_in_millis" : 1424,
    "failures" : [ ],
    "shards" : {
      "total" : 8,
      "failed" : 0,
      "successful" : 8
    },
    "feature_states" : [ ]
  }
}