From 186c477f3c2d56ee5b3614de24d3173fa8881fa2 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 7 Feb 2022 00:17:26 -0800 Subject: [PATCH] init console server after server config is initialized fixes #14259 --- cmd/server-main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/server-main.go b/cmd/server-main.go index 7b595f665..007d355c1 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -531,19 +531,6 @@ func serverMain(ctx *cli.Context) { } } - if globalBrowserEnabled { - srv, err := initConsoleServer() - if err != nil { - logger.FatalIf(err, "Unable to initialize console service") - } - - setConsoleSrv(srv) - - go func() { - logger.FatalIf(newConsoleServerFn().Serve(), "Unable to initialize console server") - }() - } - newObject, err := newObjectLayer(GlobalContext, globalEndpoints) if err != nil { logFatalErrs(err, Endpoint{}, true) @@ -576,6 +563,19 @@ func serverMain(ctx *cli.Context) { logger.LogIf(GlobalContext, err) } + if globalBrowserEnabled { + srv, err := initConsoleServer() + if err != nil { + logger.FatalIf(err, "Unable to initialize console service") + } + + setConsoleSrv(srv) + + go func() { + logger.FatalIf(newConsoleServerFn().Serve(), "Unable to initialize console server") + }() + } + // Populate existing buckets to the etcd backend if globalDNSConfig != nil { // Background this operation.