[SOLVED] Command Line Tools - constant *panic*

Environment

GitLab 8.16.2 on RHEL 7 omnibus install

The version of Mattermost reports as:

  • Version: 3.6.0
  • Build Number: 3.6.1
  • Build Date: Thu Jan 19 20:03:23 UTC 2017
  • Build Hash: 0d8bb03b5773923cf52f4d8cb2711131caae105c
  • Build Enterprise Ready: false

Question 1

How should I be accessing the Command Line Tools?

When I read the fine manual
it says to invoke commands like:

platform version

This does not work for me. I have to use

mattermost version

Is there a more up-to-date command line tool doc?

Question 2

Many commands fail immediately like:

sudo -u mattermost ./mattermost roles system_admin snuffy.smith

gives me

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x419fa8]
goroutine 1 [running]:
panic(0xbdc8c0, 0xc4200100a0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.getUserFromUserArg(0x7ffd3226b8cd, 0xb, 0x1)
/home/ubuntu/workspace/msr/platform-release/src/github.com/mattermost/platform/cmd/platform/userargs.go:21 +0x28
main.getUsersFromUserArgs(0xc420570b60, 0x1, 0x1, 0xc4205cbb98, 0x94ab76, 0xb9c960)
…etc.

Some commands give me the panic message but only after it fulfills the command request:

mattermost version

gives me

Version: 3.6.0
Build Number: 3.6.1
Build Date: Thu Jan 19 20:03:23 UTC 2017
Build Hash: 0d8bb03b5773923cf52f4d8cb2711131caae105c
Build Enterprise Ready: false
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x41a6c8]
goroutine 1 [running]:
panic(0xbdc8c0, 0xc420010090)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
…etc.

What is causing the panic for me and how can I execute commands like giving sysadmin role to some of my users?

Many thanks!

This happened to me when platform couldn’t find its config file. Can you try to specity the path to the config with “platform -c /path/to/config.json”?

Thank you for the reply!

The platform command is not found:

sudo -u mattermost /opt/gitlab/embedded/bin/platform -c /var/opt/gitlab/mattermost/config.json
sudo: /opt/gitlab/embedded/bin/platform: command not found

Running the same command for mattermost tho:

sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -c /var/opt/gitlab/mattermost/config.json
flag provided but not defined: -c
Usage:
platform [flags]
platform [command]

Available Commands:
channel Management of channels
import Import data.
ldap LDAP related utilities
license Licensing commands
reset Reset the database to initial state
roles Management of user roles
server Run the Mattermost server
team Management of teams
user Management of users
version Display version information

Flags:
-c, --config string Configuration file to use. (default “config.json”)

Use “platform [command] --help” for more information about a command.

Ahhhh!

This worked for me:

sudo -u mattermost /opt/gitlab/embedded/bin/mattermost roles system_admin snuffy.smith -c /var/opt/gitlab/mattermost/config.json

I still don’t see why I am using the mattermost command instead of platform but I have a workable solution now.