Summary
I'm happily working with Mattermost 3.5.0 (Build Hash: 3f19ccf1b1a6efdcc990cf8a0270ec4ffc0c6e22, Build Date: Tue Nov 15 18:55:53 UTC 2016), which is bundled with the most recent GitLab Omnibus (8.14.1). I've never used the CLI before, so I don't know if it worked in older releases.
Whenever I run the CLI with the -config
option, I get the following error (it doesn't matter if i sudo or not):
$ sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config=/var/opt/gitlab/mattermost/config.json -version
[2016/12/01 14:00:57 CET] [EROR] Failed to load system translations for 'en' attempting to fall back to 'en'
panic: Failed to load system translations for 'en'
goroutine 1 [running]:
panic(0xb5c580, 0xc4204b5af0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/mattermost/platform/utils.GetTranslationsBySystemLocale(0x0)
/var/lib/jenkins/jobs/msr/jobs/platform-release/workspace/src/github.com/mattermost/platform/utils/i18n.go:50 +0x374
github.com/mattermost/platform/utils.InitTranslations(0xc4204b55f0, 0xc4204b5600, 0xc4204b5610)
/var/lib/jenkins/jobs/msr/jobs/platform-release/workspace/src/github.com/mattermost/platform/utils/i18n.go:27 +0x54
main.main()
/var/lib/jenkins/jobs/msr/jobs/platform-release/workspace/src/github.com/mattermost/platform/mattermost.go:114 +0xa4
If I run the command without the path to the config file it complains, obviously, it can't find the config file, but at least it doesn't panic:
$ sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -version
[14:02:45 CET 2016/12/01] [EROR] (main.main:107) Unable to load mattermost configuration file: utils.config.load_config.opening.panic
I don't know how Mattermost searches for its translation files, but in my understanding the files are there (again, it doesn't matter if I change the owner of the files):
$ ls -alh /opt/gitlab/embedded/service/mattermost/i18n
total 2.1M
drwxr-xr-x 2 root root 4.0K Nov 28 19:45 .
drwxrwxr-x 7 root root 4.0K Nov 28 19:45 ..
-rw-r--r-- 1 root root 187K Nov 28 17:22 de.json
-rw-r--r-- 1 root root 174K Nov 28 17:22 en.json
-rw-r--r-- 1 root root 190K Nov 28 17:22 es.json
-rw-r--r-- 1 root root 193K Nov 28 17:22 fr.json
-rw-r--r-- 1 root root 207K Nov 28 17:22 ja.json
-rw-r--r-- 1 root root 184K Nov 28 17:22 ko.json
-rw-r--r-- 1 root root 184K Nov 28 17:22 nl.json
-rw-r--r-- 1 root root 185K Nov 28 17:22 pt-BR.json
-rw-r--r-- 1 root root 236K Nov 28 17:22 ru.json
-rw-r--r-- 1 root root 166K Nov 28 17:22 zh_CN.json
-rw-r--r-- 1 root root 168K Nov 28 17:22 zh_TW.json
I've looked at the following issues, but they relate to much older versions of Mattermost and none of them brought up a solution that worked in this case:
- http://forum.mattermost.org/t/proper-cli-usage-in-gitlab/839
- http://forum.mattermost.org/t/found-workaround-cli-tool-still-crashing-and-throwing-errors-in-2-1-0/1132
- forum.mattermost.org/t/mattermost-init-script/2187 (sorry, I'm not allowed to post more than two links)
Steps to reproduce
- install most recent GitLab Omnibus (8.14.1) on Ubuntu 14.04.5 LTS
- fire the CLI with the path to the config file:
sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config=/var/opt/gitlab/mattermost/config.json -help
EDIT: I forgot to mention, there are no log entries to this error. But just a few moments ago I've found a workaround in forum.mattermost.org/t/solved-how-to-authenticate-bots-using-the-api/2405/2