Admin account is locked in Preview Mattermost using Docker. How to fix?

Hi.

Summary
Admin account is locked in Preview Mattermost using Docker.

Steps to reproduce
Many failed password attempts.

How do I recover the admin password if I use Preview Mattermost (without connected mail) + Docker install?

I remember the password. But I can’t login.

Were you able to resolve this? I have the same problem. I am locked out of my admin account and do not have email connected.

Hi,

you both could use mmctl to reset the password or the e-mail address.
Depending on your deployment mode, you can access mmctl either directly from the console of your Mattermost server, or by starting it from within the container.

docker exec -ti <mattermost-container-id> mmctl ... or just mmctl ....

Since mmctl requires authentication, you should first make sure that EnableLocalMode is set to true in your config.json and restart the server, after that, you’re able to bypass user authentication via mmctl --local and can then use the user router to reset passwords, change e-mail addresses, create new accounts, etc.

Let me know if I should be more specific on any part of what I said so far and please help me doing so by providing more information about your deployment.

1 Like

Hi Alexander,
this solved my problem in a similar situation.
I have the config.json mounted as a bind mount on my host filesystem, so I edited the EnableLocalMode and restarted the server and postgres via the docker-compose up command.
I then entered MM container and from there mmctl --local and then mmctl user change-password.

Saved my day :slight_smile: thanks.

“EnableLocalMode”: true,
“LocalModeSocketLocation”: “/var/tmp/mattermost_local.socket”,

Inside container (kuber)
mmctl --local user create --email user@example.com --username userexample --password Passw
ord1 --system-admin
Error: socket file “/var/tmp/mattermost_local.socket” doesn’t exists, please check the server configuration for local mode

ls -ltra /var/tmp
total 8
drwxr-xr-x 1 root root 4096 Mar 8 2023 …
drwxrwxrwt 2 root root 4096 Mar 8 2023 .

How to solve?

@underdark456 did you restart the Mattermost container? And make sure that the volume mount for /var/tmp is writable by the Mattermost user in the container?