Admin locked out with no email enabled

Hello everybody,
I am running Mattermost (5.0.0.7) on a QNAP NAS with no email communication enabled and I locked my admin account out.

I connected via ssh to the folder where (I believe) the server is installed to try and use the CLI tools but the command “mattermost” is not recognized.

The folder where I’m looking for the installation has the following contents:

docker-compose.yml images/ log/ mattermost.sh* NOTICE.txt volumes/ flags/ LICENSE.txt mattermost.conf nginx/ utils/

Is there a way to reset my admin’s password?

PS: I am not very familiar with docker (or with qnap and .qpkg), does the .yml file mean mattermost is running on a container? If so, could I access said container like this?

Hi @McMa,

Normally this command is used. What happens when the command doesn’t work?

For all your other questions in the last paragraph, the answer is yes.

Hi @amy.blais,
thanks for your answer. The command is not recognized, this is, whenever I type a command starting with mattermost I get the error

-sh: mattermost: command not found

even though I assume I am in the correct installation directory.

Hi @McMa, would you mind runnning locate mattermost and post the output here?

I’m very certain the mattermost binary is installed to a different location we just have to find out where :slight_smile:

Hi @sven.huester and thank you for embarking with me in this pathetic adventure :smile:

I cannot run the locate command (-sh: locate: command not found) because I’m running this on a QNAP NAS*. Assuming I could find the location where Matermost is installed, I would have to switch to that directory and run the command mattermost user password ... there, right?

On the other hand, if Mattermost is running in a container, would I be able to find the directory where it is “installed”?

*[~]# cat /etc/os-release
NAME="QTS" VERSION="4.3.6 (20190531)" ID=qts PRETTY_NAME="QTS 4.3.6 (20190531)" VERSION_ID="4.3.6"

Absolutely no problem @McMa!

Regarding the container question, that’s completely up to the creator/maintainer of said container. In our official docker containers Mattermost is located at /mattermost/ in our official documentation we recommend installing it to /opt/mattermost and in the docker containers for Gitlab Mattermost is spread all over the place.

But coming back to your original message, yes if you find the mattermost binary you only have to run the previously mentioned command mattermost user password ...

You could also try finding the binary using find / -name mattermost. Let me know if it works.

I ran the find command and got the following directories/files:

/share/CACHEDEV1_DATA/.qpkg/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/sites-available/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/4e2050228982c6a4393d702e084a221af70f34078e9fc533e5bd1020265f2b65/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/4e2050228982c6a4393d702e084a221af70f34078e9fc533e5bd1020265f2b65/diff/mattermost/bin/mattermost
… (other 4 paths similar to this pair)…
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/ece0ef2e6d4d75b856a5cfc39d759f57bd831acd877c2116767abaf5fdfa7cea/merged/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/ece0ef2e6d4d75b856a5cfc39d759f57bd831acd877c2116767abaf5fdfa7cea/merged/mattermost/bin/mattermost

I tried the mattermost command in all directories to the same outcome: -sh: mattermost: command not found
Any ideas?

It looks like there are several possibilities here.
So first of we should check if Mattermost is running inside a docker container here.
Can you run the command docker ps and see if it returns anything (or is even installed)?

docker ps returns
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

if I run the docker daemon using the command dockerd in thse same directory and then docker ps I get the following empty list:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

found the images, they were running under system-docker.
I used following command to access them:
system-docker exec -it mattermost_app_1 /bin/sh

1 Like