[Found workaround] CLI tool still crashing and throwing errors in 2.1.0

using the cli tool in the gitlab omnibus is still failing in version 2.1.0:

root@gitlab:~# /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -version
panic: Failed to load system translations for 'en'
   
goroutine 1 [running]:
panic(0xb2e0c0, 0xc8201076d0)
        /usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/mattermost/platform/utils.GetTranslationsBySystemLocale(0xc8201075f3)
        /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/utils/i18n.go:44 +0x18b
github.com/mattermost/platform/utils.InitTranslations()
        /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/utils/i18n.go:29 +0x2e9
main.main()
        /var/lib/jenkins/jobs/mattermost-platform-release/workspace/src/github.com/mattermost/platform/mattermost.go:54 +0x2c

the fix mentioned here [Solved] panic: Failed to load system translations - #2 by it33 by @it33 nor the one mentioned by @cyball seem to have made it to the final release :disappointed:
the workaround downloading https://raw.githubusercontent.com/mattermost/platform/master/i18n/en.json seems to do the job, but now html templates are missing :confused:

$ /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -version
[21:33:09 CET 2016/03/22] [INFO] (github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:52) Loaded system translations for 'en' from './en.json'
[2016/03/22 21:33:09 CET] [EROR] Failed to parse server templates html/template: pattern matches no files: `./*.html`
Version: 2.1.0
Build Number: 2.1.0
Build Date: Mon Mar 14 20:45:23 UTC 2016
Build Hash: f189bc2073cf800c5f4506a69bdb51d7065269bf
Build Enterprise Ready: false

Thanks @BlueAnanas, appreciate the report, looking into this…

I can’t get the tool to do anything. I get the following error when I try to execute /opt/gitlab/embedded/bin/mattermost with or without options.

panic: invalid character ‘<’ looking for beginning of value

I had this error with the 2.0 release and it is still there in the 2.1 release.

Installation is the latest version released with GitLab yesterday… GitLab 8.6 / Mattermost 2.1

This issue relates to the following other issue http://forum.mattermost.com/t/cli-tool-crashing-missing-translation/959

[quote=“OnePressTech, post:3, topic:1132”]panic: invalid character ‘<’ looking for beginning of value[/quote]This is a simple one: you used the wrong link to download en.json :stuck_out_tongue:
The link shown on the other thread gets you the file embedded in html. But you need the raw file found on the link I stated above: https://raw.githubusercontent.com/mattermost/platform/master/i18n/en.json .

Hint: Don’t forget to su mattermost or sudo -u mattermost or you won’t get anywhere - the postgres db won’t open.

Thanks for the tip BlueAnanas. I had tried that when trying to get platform (a.k.a mattermost) tool to work in v2.0. One of the devs had said this was a known problem fixed in 2.1 so I deleted the file I had downloaded previsouly assuming the correct one would be loaded on upgrade.

So I made the change as you suggested…fixed that bug but now I have another so…still no luck.

Command I executed is:

sudo -u mattermost ./mattermost -assign_role -team_name=“MYNAME” -email="xxx@yyy.com" -role=“system_admin” -config="/var/opt/gitlab/mattermost/config.json"

The error I get is:

[EROR] (github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:38) Failed to load system translations for ‘en’ attempting to fall back to ‘en’

So far all the suggested workarounds seem to be doing just that…going around in circles. Patch “A” fixes symptom “B” but produces new bug “C” and so on.

I’m using an off-the-shelf GitLab / Mattermost omnibus installation so it is not as if I have been going off on my own path here.

I had hoped that v2.1 would fix the bug. The Mattermost dev seemed to feel he had a handle on it.

NOTE: I put the downloaded en.json file in the /opt/gitlab/embedded/bin directory where the tool resides. I assume that is the correct place to put it!

Currently best practice to use mattermost 2.1.0 CLI in a GitLab omnibus install:

  • copy en.json from /opt/gitlab/embedded/service/mattermost/i18n/ to /opt/gitlab/embedded/service/mattermost/
  • make /opt/gitlab/embedded/service/mattermost/ your current directory
  • use sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" ...
  • or su mattermost and then /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" ... if you didn’t fuss to install sudo

After following this, I still get the following error:

$> sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -create_team -team_name="testteam" -email="me@example.com"
[09:11:07 BST 2016/03/29] [INFO] (github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:52) Loaded system translations for 'en' from '/opt/gitlab/embedded/service/mattermost/i18n/en.json'
[2016/03/29 09:11:07 BST] [EROR] createTeam: , 

Installation is Gitlab/Mattermost omnibus on CentOS 7 where the Mattermost version reports as follows:

$> sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -version
[09:12:59 BST 2016/03/29] [INFO] (github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:52) Loaded system translations for 'en' from '/opt/gitlab/embedded/service/mattermost/i18n/en.json'
Version: 2.1.0
Build Number: 2.1.0
Build Date: Mon Mar 14 20:45:23 UTC 2016
Build Hash: f189bc2073cf800c5f4506a69bdb51d7065269bf
Build Enterprise Ready: false

Unfortunately not working for me.
I still get this error:

sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config=/var/opt/gitlab/mattermost/config.json -version
panic: Failed to load system translations for 'en'

goroutine 1 [running]:
github.com/mattermost/platform/utils.GetTranslationsBySystemLocale(0xc82015dcb3)
	/go/src/github.com/mattermost/platform/utils/i18n.go:44 +0x19a
github.com/mattermost/platform/utils.InitTranslations()
	/go/src/github.com/mattermost/platform/utils/i18n.go:29 +0x2e9
main.main()
	/go/src/github.com/mattermost/platform/mattermost.go:54 +0x2c

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

goroutine 5 [syscall]:
os/signal.loop()
	/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 [runnable]:
github.com/alecthomas/log4go.(*ConsoleLogWriter).run(0xc8200145a0, 0x7f126e2701e8, 0xc82002c010)
	/go/src/github.com/mattermost/platform/Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go:33 +0x69
created by github.com/alecthomas/log4go.NewConsoleLogWriter
	/go/src/github.com/mattermost/platform/Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go:26 +0xb5

Any idea on how to solve it?
@it33

I’m still getting the same error on Mattermost 2.5.0, bundled in GitLab 8.15.2.

Copying en.json is not required, but cd /opt/gitlab/embedded/service/mattermost is.

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