# 升级失败，出现“重复键值违反唯一约束”错误

**URL:** <https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767>\
**Category:** Self-hosting\
**Created:** [2020年二月27日 10:54 UTC](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767 "2020-02-27T10:54:22Z")\
**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:** [2020年二月27日 13:38 UTC](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767/3 "2020-02-27T13:38:10Z")

</div>

您的索引已损坏。请参阅 [Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes)](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400) 获取一些提示。

您是否有独立的数据库容器？我猜您有，并且需要进入该容器进行操作。

---

_[View the full topic](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767)._
