Setting the MM_SQLSETTINGS_DATASOURCEREPLICAS environment variable breaks the server startup

Description

on `Version 5.12.0`

logs:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 {"level":"info","ts":1562079176.7080698,"caller":"utils/i18n.go:83","msg":"Loaded system translations for 'en' from '/mattermost/i18n/en.json'"} {"level":"info","ts":1562079176.7084272,"caller":"app/server_app_adapters.go:58","msg":"Server is initializing..."} {"level":"debug","ts":1562079176.7092643,"caller":"utils/html.go:31","msg":"Parsing server templates at /mattermost/templates"} {"level":"info","ts":1562079176.7108283,"caller":"sqlstore/supplier.go:224","msg":"Pinging SQL master database"} {"level":"info","ts":1562079176.7128844,"caller":"sqlstore/supplier.go:224","msg":"Pinging SQL replica-0 database"} {"level":"debug","ts":1562079176.8719423,"caller":"sqlstore/preference_store.go:41","msg":"Deleting any unused pre-release features"} {"level":"error","ts":1562079176.8830707,"caller":"mailservice/mail.go:186","msg":"SMTP server settings do not appear to be configured properly err=Failed to open connection details=dial tcp: lookup dockerhost on 10.253.0.10:53: no such host"} {"level":"info","ts":1562079176.9035242,"caller":"filesstore/s3store.go:82","msg":"Connection to S3 or minio is good. Bucket exists."} {"level":"info","ts":1562079176.9063818,"caller":"app/license.go:46","msg":"License key valid unlocking enterprise features."} {"level":"info","ts":1562079176.917332,"caller":"mlog/log.go:164","msg":"Starting up plugins"} panic: reflect: reflect.Value.Set using unaddressable value goroutine 1 [running]: reflect.flag.mustBeAssignable(0x97) /usr/local/go/src/reflect/value.go:234 +0x13a reflect.Value.Set(0x153aac0, 0xc001442b70, 0x97, 0x153aac0, 0xc001442b00, 0x97) /usr/local/go/src/reflect/value.go:1467 +0x2f github.com/mattermost/mattermost-server/config.removeEnvOverrides(0xc0000f9200, 0xc0018ecc80, 0xc001fca600, 0xc00267b150) /go/src/github.com/mattermost/mattermost-server/config/environment.go:20 +0x1a8 github.com/mattermost/mattermost-server/config.(*commonStore).removeEnvOverrides(...) /go/src/github.com/mattermost/mattermost-server/config/common.go:160 github.com/mattermost/mattermost-server/config.(*commonStore).set(0xc0001bcea0, 0xc0000f7900, 0xc00267b1c8, 0xc00267b1b8, 0x0, 0x0, 0x0) /go/src/github.com/mattermost/mattermost-server/config/common.go:72 +0x142 github.com/mattermost/mattermost-server/config.(*DatabaseStore).Set(0xc0001bcea0, 0xc0000f7900, 0xc0041d0be0, 0x1b, 0xc004200200) /go/src/github.com/mattermost/mattermost-server/config/database.go:128 +0x7e github.com/mattermost/mattermost-server/app.(*Server).UpdateConfig(0xc0001b1500, 0xc00267b328) /go/src/github.com/mattermost/mattermost-server/app/config.go:53 +0xa3 github.com/mattermost/mattermost-server/app.(*App).UpdateConfig(...) /go/src/github.com/mattermost/mattermost-server/app/config.go:59 github.com/mattermost/mattermost-server/app.(*App).EnablePlugin(0xc0014eafc0, 0xc0041ad800, 0x12, 0x1a) /go/src/github.com/mattermost/mattermost-server/app/plugin.go:245 +0x1b7 github.com/mattermost/mattermost-server/app.(*App).installPlugin(0xc0014eafc0, 0x1aab640, 0xc001c6a8e0, 0x1, 0x0, 0x0) /go/src/github.com/mattermost/mattermost-server/app/plugin_install.go:87 +0x6bc github.com/mattermost/mattermost-server/app.(*App).InstallPlugin(...) /go/src/github.com/mattermost/mattermost-server/app/plugin_install.go:21 github.com/mattermost/mattermost-server/app.(*App).InitPlugins.func1(0xc0033965f0, 0x43, 0x1ad97a0, 0xc00213b790, 0x0, 0x0, 0x499a3a, 0xc00213b790) /go/src/github.com/mattermost/mattermost-server/app/plugin.go:158 +0x2c6 path/filepath.walk(0xc0033965f0, 0x43, 0x1ad97a0, 0xc00213b790, 0xc0020fd390, 0x0, 0x0) /usr/local/go/src/path/filepath/path.go:363 +0x3fb path/filepath.walk(0xc001c96e80, 0x1f, 0x1ad97a0, 0xc002571a00, 0xc0020fd390, 0x0, 0x10) /usr/local/go/src/path/filepath/path.go:387 +0x2e6 path/filepath.Walk(0xc001c96e80, 0x1f, 0xc0020fd390, 0x1f, 0xc001f1a601) /usr/local/go/src/path/filepath/path.go:409 +0xff github.com/mattermost/mattermost-server/app.(*App).InitPlugins(0xc0014eafc0, 0xc001478190, 0x9, 0xc0014781d0, 0x10) /go/src/github.com/mattermost/mattermost-server/app/plugin.go:151 +0x431 github.com/mattermost/mattermost-server/app.(*Server).RunOldAppInitalization(0xc0001b1500, 0x0, 0x1abf200) /go/src/github.com/mattermost/mattermost-server/app/server_app_adapters.go:144 +0xce4 github.com/mattermost/mattermost-server/app.NewServer(0xc0001a3cd0, 0x5, 0x5, 0x0, 0xc00227b8e0, 0x5) /go/src/github.com/mattermost/mattermost-server/app/server.go:186 +0x520 github.com/mattermost/mattermost-server/cmd/mattermost/commands.runServer(0x1ae9b20, 0xc0001bcea0, 0xc000080000, 0xc0000814a0, 0x0, 0x0) /go/src/github.com/mattermost/mattermost-server/cmd/mattermost/commands/server.go:64 +0xcb github.com/mattermost/mattermost-server/cmd/mattermost/commands.serverCmdF(0x29acf20, 0x29fd650, 0x0, 0x0, 0x0, 0x0) /go/src/github.com/mattermost/mattermost-server/cmd/mattermost/commands/server.go:53 +0x183 github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra.(*Command).execute(0x29acf20, 0xc0000321a0, 0x0, 0x0, 0x29acf20, 0xc0000321a0) /go/src/github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:762 +0x465 github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x29acf20, 0x14448f3, 0xc0001a3f88, 0xc0000360b8) /go/src/github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:852 +0x2c0 github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra.(*Command).Execute(...) /go/src/github.com/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:800 github.com/mattermost/mattermost-server/cmd/mattermost/commands.Run(...) /go/src/github.com/mattermost/mattermost-server/cmd/mattermost/commands/root.go:15 main.main() /go/src/github.com/mattermost/mattermost-server/cmd/mattermost/main.go:30 +0x89

QA Test Steps

Not sure if this is your area Dylan. Testing should include setting this env variable and making sure the server starts up. I've tried to set other random variables too, just in case. Let me know if you need some example var setting syntax.

Thanks!

Status

Mana

4

Assignee

Christopher Poile

Reporter

Carlos Panato

Epic Link

None

Fix versions

Mattermost Team

Integrations

Sprint

None

Labels

None

GitHub Issue

None

QA Assignee

Dylan Haussermann

QA Testing Areas

Other (write in QA test steps)