# Detected a corrupted repository , index\<name\> references an unknown snapshot uuid

**URL:** https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371
**Category:** Elasticsearch
**Created:** [April 29, 2020, 12:57pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371 "2020-04-29T12:57:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![spreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spreet/32/67370_2.png) [@spreet](https://discuss.elastic.co/u/spreet)
#### Post date: [April 29, 2020, 12:57pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/1 "2020-04-29T12:57:13Z")

</div>

Hi, All,

We are trying to migrate a self-managed elastic search cluster (version 5.3) to a different Elasticsearch cluster with version 7.1. Below steps works for the first time but fails when I try to restore another snapshot from 5.3 to 7.1:

First attempt

1. Take a snapshot(snap\_1) from 5.3 to a S3 repo (snapshot\_repo)
2. Spin up a temp cluster with version 6.8 as a direct restore from 5.3 to 7.1 is not allowed.
3. Register snapshot\_repo for 6.8 (same repo as 5.3)
4. Restore snap\_1 on to 6.8
5. Reindex data (To make mapping compatible with 6.8)
6. Take a new snapshot on 6.8 (snap\_2)
7. Register snapshot\_repo for 7.1 (same repo as 5.3)
8. Restore snap\_2 on 7.1
9. Delete 6.8 version ES cluster

At this time everything works as expected. The number of indices, documents, mapping, etc are the same as the 5.3 version. After this, I tried to restore a new snapshot from 5.3

Second attempt:

1. Take a snapshot(snap\_3) from 5.3 to a S3 repo (snapshot\_repo)
2. Spin up a temp cluster with version 6.8 as a direct restore from 5.3 to 7.1 is not allowed.
3. Register snapshot\_repo for 6.8 (same repo as 5.3)
4. Restore snap\_3 on to 6.8 =\> Failed (see below)

```auto

org.elasticsearch.ElasticsearchParseException: Detected a corrupted repository, index [__PATH__] references an unknown snapshot uuid [6YLEH-C_RM6SA6TPYpI9CQ]
	at org.elasticsearch.repositories.RepositoryData.snapshotsFromXContent(RepositoryData.java:466) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository.getRepositoryData(BlobStoreRepository.java:800) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.snapshots.RestoreService.restoreSnapshot(RestoreService.java:184) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:77) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:40) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:124) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$2.doRun(TransportMasterNodeAction.java:211) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:760) [elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.8.0.jar:6.8.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

```

Any ideas? What can I do to avoid this?

---

<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: [April 29, 2020, 2:07pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/2 "2020-04-29T14:07:49Z")

</div>

I suspect that once you've written to a repository with version X you probably can't write to it with a version before X without damaging it. I would recommend using two different repositories for the two steps.

---

<div class="post-metadata">

### Author: ![spreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spreet/32/67370_2.png) [@spreet](https://discuss.elastic.co/u/spreet)
#### Post date: [April 29, 2020, 2:21pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/3 "2020-04-29T14:21:56Z")

</div>

Thanks, David.

Do you mean I should take snapshot from 6.8 version to a different repository? I will have to use same repo as 5.3 to restore it to 6.8. Right?

Also, at this time I am not even able to get list of snapshots from 6.8:

GET \_snapshot/es\_s3\_snapshot\_repository/\_all?pretty

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "parse_exception",
        "reason" : "Detected a corrupted repository, index [<Index name>] references an unknown snapshot uuid [keU32XA2TNyyei949lVHIQ]"
      }
    ],
    "type" : "parse_exception",
    "reason" : "Detected a corrupted repository, index [<index name>] references an unknown snapshot uuid [keU32XA2TNyyei949lVHIQ]"
  },
  "status" : 400
}

```

I can see list of snapshots from 5.3 cluster but not with 6.8. How do I recover from this?

I can try something like this :

1. Register a new repo for 5.3 (repo2)
2. Take a snapshot from 5.3 (repo2\_snap\_1)
3. Spin up 6.8 cluster
4. Register repo2 for 6.8  
4 Restore repo2\_snap\_1 on 6.8
5. Reindex data on 6.8
6. Register a new repo on 6.8 (repo3)
7. Take a new snapshot(repo3\_snap1) from 6.8
8. Register repo3 on 7.1 version
9. Restore repo3\_snap1 on 7.1  
10 Delete 6.8 cluster

---

<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: [April 29, 2020, 2:36pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/4 "2020-04-29T14:36:22Z")

</div>

> [@spreet](#):
>
> I can try something like this :

Yes, I think that sounds good.

---

<div class="post-metadata">

### Author: ![spreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spreet/32/67370_2.png) [@spreet](https://discuss.elastic.co/u/spreet)
#### Post date: [April 30, 2020, 1:29pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/5 "2020-04-30T13:29:32Z")

</div>

David, Thanks for the pointer. Using different repo's for each ES version fixed this issue. But I still don't know how to fix previous repo with mixed snapshots from 2 different versions of ES 🙂

---

<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: [April 30, 2020, 3:42pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/6 "2020-04-30T15:42:47Z")

</div>

I don't think there's a way to rescue a repository that's in that state, sorry.

---

<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: [May 28, 2020, 3:42pm UTC](https://discuss.elastic.co/t/detected-a-corrupted-repository-index-name-references-an-unknown-snapshot-uuid/230371/7 "2020-05-28T15:42:48Z")

</div>

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