# Unable to create user

**URL:** <https://forum.mattermost.com/t/unable-to-create-user/15560>\
**Category:** Command Line Interface\
**Created:** [April 3, 2023, 3:56pm UTC](https://forum.mattermost.com/t/unable-to-create-user/15560 "2023-04-03T15:56:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/tomz/32/4932_2.png) [@tomz](https://forum.mattermost.com/u/tomz)\
**Post date:** [April 3, 2023, 3:56pm UTC](https://forum.mattermost.com/t/unable-to-create-user/15560/1 "2023-04-03T15:56:23Z")

</div>

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?

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

```

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [April 4, 2023, 3:44am UTC](https://forum.mattermost.com/t/unable-to-create-user/15560/2 "2023-04-04T03:44:21Z")

</div>

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:

```auto
# 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:

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![tomz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/tomz/32/4932_2.png) [@tomz](https://forum.mattermost.com/u/tomz)\
**Post date:** [April 4, 2023, 6:41am UTC](https://forum.mattermost.com/t/unable-to-create-user/15560/3 "2023-04-04T06:41:02Z")

</div>

> [@agriesser](#):
>
> you can skip the `--config` option

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.

> [@agriesser](#):
>
> Can you share the output of:

Here you go:

```auto
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!

> [@agriesser](#):
>
> 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

Makes perfect sense now.

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

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [April 4, 2023, 7:07am UTC](https://forum.mattermost.com/t/unable-to-create-user/15560/4 "2023-04-04T07:07:27Z")

</div>

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