# Duplicate email address in user profile

**URL:** https://meta.discourse.org/t/duplicate-email-address-in-user-profile/181442
**Category:** Support
**Created:** [March 1, 2021, 8:08am UTC](https://meta.discourse.org/t/duplicate-email-address-in-user-profile/181442 "2021-03-01T08:08:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![some-user](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@some-user](https://meta.discourse.org/u/some-user)
#### Post date: [March 1, 2021, 8:08am UTC](https://meta.discourse.org/t/duplicate-email-address-in-user-profile/181442/1 "2021-03-01T08:08:37Z")

</div>

In one of the user profiles, there is the exact same email address twice in the list of email addresses. The first entry is marked as “primary”. The second one is “unconfirmed”.

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/2/e244b5032ad5d4484cb370e106fe824443eab05b.png)

The user can neither remove the second address nor confirm it (there is an user with this address already…). Nor can I remove it (DELETE request gets 428 response).

I tried to search the database. The table `user_emails` only lists one entry. Any idea how this can happen and how to get it resolved?

---

<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: [March 1, 2021, 12:34pm UTC](https://meta.discourse.org/t/duplicate-email-address-in-user-profile/181442/2 "2021-03-01T12:34:29Z")

</div>

It might be that you have a corrupt index. What version of discourse and Postgres do you have?

Do you have social logins enabled? One possibility is that they tried to sign up with the email address, didn’t respond to the validation email, and then used social login.

I’d probably try to fix it at the rails console or perhaps directly in sql.

Other than it being confusing that the address shows twice, there is no actual problem, right? The user can log in, but has an extra address in their profile.

---

<div class="post-metadata">

### Author: ![some-user](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@some-user](https://meta.discourse.org/u/some-user)
#### Post date: [March 1, 2021, 12:46pm UTC](https://meta.discourse.org/t/duplicate-email-address-in-user-profile/181442/3 "2021-03-01T12:46:50Z")

</div>

> [@pfaffman](#):
>
> What version of discourse and Postgres do you have?

- Discourse 2.7.0.beta4 ([33df4233c9](https://github.com/discourse/discourse/commits/33df4233c9e3a5b5aade42edcb13669633097423))
- Postgres 13 (dpkg says: `13.1-1.pgdg100+1`)

> [@pfaffman](#):
>
> Do you have social logins enabled?

Yes, they are. This user is not connected to any of them, so currently could not use it – to my understanding.

> [@pfaffman](#):
>
> I’d probably try to fix it at the rails console or perhaps directly in sql.

I tried, but could find a duplicate address in sql. `user_emails` shows only one row for this user, `user_open_ids` and `user_associated_accounts` have no entry. Any hint where to search?

> [@pfaffman](#):
>
> Other than it being confusing that the address shows twice, there is no actual problem, right? The user can log in, but has an extra address in their profile.

That’s right. I’m worried it could be a symptom of a problem, that shows more severe symptoms later and could be fixed early.
