Proper CLI usage in Gitlab

This is just a note for anyone running into the same issues that I was running into.

There are point in documentation that suggest running /platform -version, or similar things. This just adds confusion when dealing with GitLab Mattermost. Here’s what worked for me:


I ran
sudo -u mattermost ./mattermost -config=/var/opt/gitlab/mattermost/config.json

This was the only way to get it to work. In other words, “sudo -u mattermost ./mattermost” takes the place of “platform” anywhere you see it in documentation, and you have to append -config at the end.

Hopefully this will help clarify things for other users.

1 Like

Thanks! I found this helpful :smiley:

When trying to run
sudo -u mattermost ./mattermost -config=/var/opt/gitlab/mattermost/config.json -version
I get: command mattermost can't be found.

Trying this however:
sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config=/var/opt/gitlab/mattermost/config.json -version
is returning following error:

panic: Failed to load system translations for 'en'

goroutine 1 [running]:
	/go/src/ +0x19a
	/go/src/ +0x2e9
	/go/src/ +0x2c

goroutine 17 [syscall, locked to thread]:
	/usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [syscall]:
	/usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
	/usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 6 [chan receive]:*ConsoleLogWriter).run(0xc82000e580, 0x7fe2513041e8, 0xc820032010)
	/go/src/ +0x69
created by

Any ideas?

Hi @derblub, this issue happens in Mattermost 2.0, and was fixed in Mattermost 2.1. You can upgrade to the next version to resolve this issue.

Mattermost 2.0 introduced multi-language support and this issue was caused by that change, and fixed in the next monthly release.

Sorry, but apparently it isn’t fixed.

Mattermost Team Edition
Build Number:6671
Build Date:Fri Apr 15 18:40:19 UTC 2016
Build Hash:8e883ad2f516820942cc0131241268c1ea909ff3

Thanks @derblub, appreciate the report, ticket has been re-opened on this.

did you use the best practice described in [Found workaround]CLI tool still crashing and throwing errors in 2.1.0

I’m on GitLab CE 10.1.1 running on docker. That’s how it works for me:

docker exec -it -u mattermost <container> bash
cd /opt/gitlab/embedded/service/mattermost
mattermost -c /var/opt/gitlab/mattermost/config.json version
Version: 4.2.0