# 손상된 인덱스로 인해 복원 불가 (손상된 인덱스 해결 방법 힌트 포함)

**URL:** https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400
**Category:** Self-hosting
**Created:** [12월 30, 2019, 11:22오후 UTC](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400 "2019-12-30T23:22:13Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [1월 3, 2020, 5:30오후 UTC](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400/3 "2020-01-03T17:30:37Z")

</div>

Gerhard님, 감사합니다! 도움을 주셔서 정말 감사드립니다. 이 문제는 점점 더 기묘해지고 있습니다.

`incoming_referers`에 문제가 있었다는 것도 저한테는 이해가 안 됩니다. 10월에도 프로덕션에서 이 스테이징 사이트로 복원을 한 적이 있습니다.

데이터베이스나 인덱스에 뭔가 문제가 있는 것 같습니다. 플러그인 때문이라고 의심했지만, 에러가 서로 다른 인덱스 여러 곳에서 발생하고 있어 단일 플러그인이 원인이었을 가능성은 낮아 보입니다. 손상된 인덱스 문제를 찾기 위해 플러그인에서 `grep`을 수행해 보았지만 아무것도 나오지 않았습니다.

최근 한 번의 복원에서는 다음과 같은 결과가 나왔습니다:

```plaintext
[2020-01-03 16:25:30] ERROR: could not create unique index "index_plugin_store_rows_on_plugin_name_and_key"

```

다음과 같이 실행해 보았습니다:

```
[10] pry(main)> PluginStoreRow.where(plugin_name: 'discourse-data-explorer',key: 'q:-8').destroy_all

```

그리고 다시 시도했습니다:

```plaintext
[2020-01-03 16:49:16] ERROR: could not create unique index "index_tags_on_lower_name"
[2020-01-03 16:49:16] DETAIL: Key (lower(name::text))=(addins) is duplicated.

```

최근 복원의 전체 로그 상단 부분은 다음과 같습니다:

```plaintext
[2020-01-03 16:41:34] 'pfaffman' has started the restore!
[2020-01-03 16:41:34] Marking restore as running...
[2020-01-03 16:41:34] Making sure /var/www/discourse/tmp/restores/default/2020-01-03-164133 exists...
[2020-01-03 16:41:34] Downloading archive to tmp directory...
[2020-01-03 16:45:20] No metadata file to extract.
[2020-01-03 16:45:20] Validating metadata...
[2020-01-03 16:45:20] Current version: 20191220134101
[2020-01-03 16:45:20] Restored version: 20191129144706
[2020-01-03 16:45:20] Extracting dump file...
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:15] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] CREATE INDEX
[2020-01-03 16:49:16] ERROR: could not create unique index "index_tags_on_lower_name"
[2020-01-03 16:49:16] DETAIL: Key (lower(name::text))=(addins) is duplicated.
[2020-01-03 16:49:16] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2020-01-03 16:49:16] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2020-01-03 16:49:16] ERROR: current transaction is aborted, commands ignored until end of transaction block

```

---

_[View the full topic](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400)._
