Unable to create user

I am running MM with docker and am trying to create a new user.
Most of my users are github/Keycloak based users, but now I have to create a local user and ran into the issue below.
I worked my way through the error messages and have now local mode enabled, I can see the socket is created:

mattermost@c1a09d28c321:~$ ls -l /var/tmp
total 0 
srw------- 1 mattermost mattermost 0 Apr  3 17:38 mattermost_local.socket

Calling mmctl like below:

mmctl user create --local --email name.lastname@t-online.de --username "name.lastname" --password mypassword --config /mattermost/config/config.json
Error: Unable to create user. Error: : Der Login schlug fehl, weil das Passwort ungültig ist., invalid password

Not sure what password is expected, also a bit strange that the error comes up in German.
Anyone got an idea what might be going on?

mattermost@c1a09d28c321:~$ mmctl version
Version:        v7.8.3
GitCommit:      9025f404d8d7140d8eac5539f6864376525d4ea9
GitTreeState:   "clean"
BuildDate:      2023-03-21T11:46:19Z
GoVersion:      go1.18.1
Compiler:       gc
Platform:       linux/amd64

Hey tomz,

you can skip the --config option, this is not meant to be the Mattermost server’s config.json, but a local configuration file for mmctl where you can store settings for it.

Can you share the output of:

# mmctl --local config get PasswordSettings
  "MinimumLength": 8,
  "Lowercase": false,
  "Number": false,
  "Uppercase": false,
  "Symbol": false

And compare the rules there with the password you tried to set? I can reproduce this error message only when I break the configured rules for the new password (in my example below, it’s too short).

With regards to the error message being in German: This happens when the LocalizationSettings.DefaultClientLocale is set to German. mmctl is also just a client and when it establishes a session, it inherits the locale setting:

# mmctl --local config get LocalizationSettings
  "DefaultServerLocale": "en",
  "DefaultClientLocale": "de",
  "AvailableLocales": ""

# mmctl --local user create --email asdf@asdf.com --username asdf --password asdf
Error: Unable to create user. Error: : Der Login schlug fehl, weil das Passwort ungültig ist., invalid password

A server restart is necessary after changing the DefaultClientLocale, JFYI.

I think I initially got an error that the config file can’t be found, but can’t reproduce this behaviour any longer. Maybe it had to with local not set to true initially.

Here you go:

sudo docker exec mattermost-app  mmctl --local config get PasswordSettings
  "MinimumLength": 10,
  "Lowercase": true,
  "Number": true,
  "Uppercase": true,
  "Symbol": true

And there’s the problem, min length 10! The error message is a little misleading as I read this as somehow mmctl is unable to logon, but hey, problem solved!

Makes perfect sense now.

I really appreciate your quick and comprehensive help with this.
Thanks a lot

You’re welcome, glad to see you got it working now :slight_smile: