# 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:** 17

<div class="post-metadata">

**Author:** ![Gunnar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gunnar/32/119647_2.png) [@Gunnar](https://meta.discourse.org/u/Gunnar)\
**Post date:** [January 23, 2021, 8:31pm UTC](https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980/17 "2021-01-23T20:31:09Z")

</div>

> [@omarfilip](#):
>
> reindex the database

I’m not a database guy, so that looks scary. And if I read it correctly, you then end up with duplicate indices, and have to delete them manually?

Besides, here’s the strange part. Like you found on my site with the previous duplicate, I found a duplicate user RobS in the GUI now. But, just like before, no matter which of them I clicked, I ended up on the profile page of just one of them. I.e.:

- List users named RobS in the GUI. Find two. See that both have different stats.
- Click user #1. See profile and stats belonging to user #2.
- Click user #2. See profile and stats belonging to user #2.

`select * from users WHERE username_lower = 'robs';`

Returns 1 row: What looks like user #2 (the dates match).

`select * from users WHERE username = 'RobS';`

Also returns only 1 row: What looks like user #1 (again, the dates match). This user has a different ID from the other one.

Judging by the output, they both had the same `username` and `username_lower`, yet only 1 row was returned for each SELECT statement. Is my database in serious trouble?

Would a reindexing fix this?

---

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