diff --git a/cmd/mattermost/commands/server.go b/cmd/mattermost/commands/server.go index 238018be3d..34ffd2ae93 100644 --- a/cmd/mattermost/commands/server.go +++ b/cmd/mattermost/commands/server.go @@ -7,6 +7,7 @@ import ( "net" "os" "os/signal" + "runtime/debug" "syscall" "github.com/mattermost/mattermost-server/v5/api4" @@ -54,6 +55,11 @@ func serverCmdF(command *cobra.Command, args []string) error { } func runServer(configStore config.Store, disableConfigWatch bool, usedPlatform bool, interruptChan chan os.Signal) error { + // Setting the highest traceback level from the code. + // This is done to print goroutines from all threads (see golang.org/issue/13161) + // and also preserve a crash dump for later investigation. + debug.SetTraceback("crash") + options := []app.Option{ app.ConfigStore(configStore), app.RunJobs,