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" : [ ]
  }
}

@stephenb
I followed all the steps as you said but after some time running this query ;

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"
  }
}

it keeps giving same error. I don't understand what permissions you are talking about.
Are you talking about permissions like this xpack.security.enabled: true . The backup process may continue in the background after giving this error. Because when I run the following query;
GET /_snapshot/backup_repository_bills_enn/_all
it first gave me an in-progress notification, and then it gave me a successful notification.

{
  "snapshots" : [
    {
      "snapshot" : "my_snapshot",
      "uuid" : "4Sv055VjQDSZvpBqSvCxpg",
      "version_id" : 7100199,
      "version" : "7.10.1",
      "indices" : [
        "my_index"
      ],
      "data_streams" : [ ],
      "include_global_state" : false,
      "metadata" : {
        "taken_by" : "busra duygu",
        "taken_because" : "backup for my_index"
      },
      "state" : "IN_PROGRESS",
      "start_time" : "2021-09-09T06:22:16.414Z",
      "start_time_in_millis" : 1631168536414,
      "end_time" : "1970-01-01T00:00:00.000Z",
      "end_time_in_millis" : 0,
      "duration_in_millis" : 0,
      "failures" : [ ],
      "shards" : {
        "total" : 0,
        "failed" : 0,
        "successful" : 0
      }
    }
  ]
}

As far as I understand, it did the backup process, but when I restore this index, it never works. I thought it was not properly backed up. The funny thing is that only this index has such a problem.I tried it in all my other indexes and I did not get such an error in any of them, and the backup and restore process worked properly in all of them.

Well if it works for every other index I suspect perhaps there's something wrong with that index.

You are right, there may be a problem with this index. The following code block is the settings of the index. Is there anything that seems strange to you?

"my_index_name" : {
    "settings" : {
      "index" : {
        "routing" : {
          "allocation" : {
            "include" : {
              "_tier_preference" : "data_content"
            }
          }
        },
        "refresh_interval" : "5s",
        "number_of_shards" : "1",
        "provided_name" : "my_index_name",
        "max_result_window" : "500000000",
        "creation_date" : "1611080136687",
        "analysis" : {
          "filter" : {
            "my_ascii_folding" : {
              "type" : "asciifolding",
              "preserve_original" : "true"
            },
            "english_stemmer" : {
              "type" : "stemmer",
              "language" : "english"
            },
            "english_possessive_stemmer" : {
              "type" : "stemmer",
              "language" : "possessive_english"
            },
            "english_stop" : {
              "type" : "stop",
              "stopwords" : [
                "_english_"
              ]
            }
          },
          "analyzer" : {
            "english_analyzer" : {
              "filter" : [
                "my_ascii_folding",
                "lowercase",
                "english_stop",
                "english_stemmer",
                "english_possessive_stemmer"
              ],
              "type" : "custom",
              "tokenizer" : "standard"
            }
          },
          "tokenizer" : {
            "comma_analyzer" : {
              "pattern" : ",",
              "type" : "pattern"
            }
          }
        },
        "number_of_replicas" : "0",
        "uuid" : "bcffDF556df4gfdf4h54fkj5f1h",
        "version" : {
          "created" : "7100199"
        }
      }
    }
  }
}

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