# 2.7.0.beta2 upgrade failed with ERROR: duplicate key

**URL:** https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980
**Category:** Self-hosting
**Created:** [January 22, 2021, 8:25pm UTC](https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980 "2021-01-22T20:25:45Z")
**Posts on this page:** 1
**Showing post:** 16

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [January 23, 2021, 6:58pm UTC](https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980/16 "2021-01-23T18:58:03Z")

</div>

> [@Gunnar](#):
>
> find them and fix them all before I try again

A less invasive approach may be to reindex the database before upgrading and should tell you which ones need to be fixed.

> [@Corrupt indexes in PG12, how do I fix?](https://meta.discourse.org/t/corrupt-indexes-in-pg12-how-do-i-fix/152570):
>
> Sorry for bumping this once again, I got a very strange discourse=# REINDEX SCHEMA CONCURRENTLY public; ERROR: could not create unique index "index\_tags\_on\_name\_ccnew" DETAIL: Key (name)=(chronicillness) is duplicated. I’m assuming it can be fixed by the solution suggested above by @riking but I’m unable to figure out how to modify the syntax to suit my case. frowning

---

_[View the full topic](https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980)._
