Cannot create users with CLI

Hello everyone,
I have a dockerized Mattermost server installed in a container and is working fine. I just wanted to add a few lin commands in my docker-compose file to be able to create the two users I need, instead of having them created manually every time I raise the container.

These are the commands I’m running in my docker-compose:

/mm/mattermost/bin/mattermost user create --email myemail@mail.com --username myuser --password mypassword
/mm/mattermost/bin/mattermost team create --name myteam --display_name “myteam”
/mm/mattermost/bin/mattermost team add myteam user1 user2

When I try to log in with any of the two users I configured, I get “We couldn’t find an account matching your login credentials.”

I tried executing the commands inside the container to check if the compose was failing. This is what a get when I entered the user creation command:

It seems I cannot reach the DataBase for some reason.

I create the Mattermost container I used GitHub - mattermost/mattermost-docker-preview: Mattermost Preview Docker Image

Hello, @ccastmar

I tested this on my end to verify if there is something wrong with the command but it works fine on my end:

mattermost user create

root@3eea4387dbb8:/mm/mattermost/bin# mattermost user create --email admin@test.com --username admin --password admin --system_admin
{"level":"info","ts":1572847020.3920069,"caller":"utils/i18n.go:78","msg":"Loaded system translations for 'en' from '/mm/mattermost/i18n/en.json'"}
{"level":"info","ts":1572847020.3921587,"caller":"app/app.go:143","msg":"Server is initializing..."}
{"level":"info","ts":1572847020.3947682,"caller":"sqlstore/supplier.go:207","msg":"Pinging SQL master database"}
{"level":"info","ts":1572847020.4682183,"caller":"app/plugin.go:130","msg":"Starting up plugins"}
{"level":"error","ts":1572847020.468519,"caller":"app/plugin.go:138","msg":"Failed to start up plugins","error":"mkdir ./client/plugins: no such file or directory"}
Created User
{"level":"info","ts":1572847020.5490918,"caller":"app/app.go:216","msg":"Stopping Server..."}
{"level":"info","ts":1572847020.549149,"caller":"app/web_hub.go:120","msg":"stopping websocket hub connections"}
{"level":"warn","ts":1572847020.5492184,"caller":"app/web_hub.go:125","msg":"We appear to have already sent the stop checking for deadlocks command"}
{"level":"info","ts":1572847020.5497634,"caller":"sqlstore/supplier.go:850","msg":"Closing SqlStore"}
{"level":"info","ts":1572847020.5504858,"caller":"app/app.go:237","msg":"Server stopped"}

System Console

May I know if you can consider reinstalling it again by running the commands below before trying to access the shell again?

docker stop mattermost-preview
docker rm -v mattermost-preview