# \[Solved\] We couldn't find the existing account, Gitlab Mattermost 8

**URL:** https://forum.mattermost.com/t/solved-we-couldnt-find-the-existing-account-gitlab-mattermost-8/578
**Category:** Troubleshooting
**Created:** [December 2, 2015, 3:51pm UTC](https://forum.mattermost.com/t/solved-we-couldnt-find-the-existing-account-gitlab-mattermost-8/578 "2015-12-02T15:51:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Slimmons](https://forum.mattermost.com/u/Slimmons)
#### Post date: [December 2, 2015, 3:51pm UTC](https://forum.mattermost.com/t/solved-we-couldnt-find-the-existing-account-gitlab-mattermost-8/578/1 "2015-12-02T15:51:04Z")

</div>

I know this is covered [here](https://forum.mattermost.com/t/gitlab-mattermost-needs-your-help-we-couldnt-find-the-existing-account/185), and there is a solution [here](https://github.com/mattermost/platform/blob/master/doc/install/Troubleshooting.md#we-couldnt-find-the-existing-account), but I’m still having this issue.

I have gitlab omnibus CE 8.1.3

I’ve followed the steps in the troubleshooting guide, but I’m having a problem.  
**First:** The solution states that these steps are for an account that has System Admin prvileges, but I’m assuming it works for normal accounts too

**Second:** Step a.b. says “Change email for account to random address so you can create a new GitLab SSO account using your regular address”. Since the user can’t log in to change his address, and I can’t seem to find a way to change his address as an admin…how do I change his address? I’m guessing there’s either a way I’m not seeing in the UI, or I need to do it by directly connecting to the database. I just didn’t want to do that until I have some verification that I wouldn’t totally bork anything.

If I do need to connect to the DB to change the email address, does mattermost have a separate DB from gitlab, and how do I connect to the mattermost db? I’m kind of afraid to go in and change anything I’m not certain of since it would be pretty terrible to mess up their gitlab account.

Any help is greatly appreciated.

---

<div class="post-metadata">

### Author: ![jwilander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jwilander/32/8440_2.png) [@jwilander](https://forum.mattermost.com/u/jwilander)
#### Post date: [December 2, 2015, 5:40pm UTC](https://forum.mattermost.com/t/solved-we-couldnt-find-the-existing-account-gitlab-mattermost-8/578/2 "2015-12-02T17:40:44Z")

</div>

#### If you’re running Mattermost 1.3+ you can do the following:

Ok, as an admin you don’t have direct access through the UI to change the user’s email address (this is a feature we’d like to add as we expand the functionality of the System Console).

You can fix this by permanently deleting the user’s Mattermost account (don’t worry it won’t touch their GitLab account). The command to do this is:

`platform -permanent_delete_user -team_name="name" -email="user@example.com"`

They should then be able to go and create a new account using GitLab SSO.

**IMPORTANT NOTES**

1. This will totally wipe out any posts that the user has made before.
2. Strongly suggest backing up your DB before attempting this.

There is also the possibility of manually updating the email address to something random so you don’t have to delete the user but we super strongly suggest no one messes directly with the DB.

---

<div class="post-metadata">

### Author: ![Slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Slimmons](https://forum.mattermost.com/u/Slimmons)
#### Post date: [December 2, 2015, 9:26pm UTC](https://forum.mattermost.com/t/solved-we-couldnt-find-the-existing-account-gitlab-mattermost-8/578/3 "2015-12-02T21:26:15Z")

</div>

Thanks to jwilander for helping me out so much with this. I’m leaving his answer up in case someone else has this problem with version 1.3+, but he helped me in chat, and here’s what we did.

I needed to change the username and email address of the user that is now blocked. Meaning, I have to put in different values so that that user can recreate their account, using the same username and email, and the old account sits there, with dummy information.

For this “guide” I’ll pretend like my co-workers name is John Doe

Here’s how I did it (once again with very patient help from jwilander)

**Log into the gitlab omnibus postgres db**  
Found [here](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/738)

`sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production`

**Connect to the mattermost table**

`\connect mattermost_production;`

**Change the username and email values of the broken account**

`UPDATE users SET email = 'anyTrashValue@example.com' WHERE email = 'john.doe@example.com';`

`UPDATE users SET username = 'fakeName' WHERE username = 'john.doe';`

If you aren’t sure what their username/password are, and they aren’t available, you can check it using  
`SELECT * FROM users;`  
or, if you know their name  
`SELECT * FROM users WHERE username = 'john.doe';`  
now you can see what email they used.

**Log in again**  
Now resend them a login link to your team, and you should be all done.

Thanks again for the help
