diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index 34f6ca8d5..920a8066c 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -229,15 +229,6 @@ func StartGateway(ctx *cli.Context, gw Gateway) { globalObjectAPI = newObject globalObjLayerMutex.Unlock() - // Populate existing buckets to the etcd backend - if globalDNSConfig != nil { - buckets, err := newObject.ListBuckets(context.Background()) - if err != nil { - logger.Fatal(err, "Unable to list buckets") - } - initFederatorBackend(buckets, newObject) - } - // Migrate all backend configs to encrypted backend, also handles rotation as well. // For "nas" gateway we need to specially handle the backend migration as well. // Internally code handles migrating etcd if enabled automatically. @@ -286,6 +277,15 @@ func StartGateway(ctx *cli.Context, gw Gateway) { globalObjLayerMutex.Unlock() } + // Populate existing buckets to the etcd backend + if globalDNSConfig != nil { + buckets, err := newObject.ListBuckets(context.Background()) + if err != nil { + logger.Fatal(err, "Unable to list buckets") + } + initFederatorBackend(buckets, newObject) + } + // Verify if object layer supports // - encryption // - compression diff --git a/cmd/server-main.go b/cmd/server-main.go index c249a1fe5..ec57753f1 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -374,11 +374,6 @@ func serverMain(ctx *cli.Context) { logger.Fatal(err, "Unable to list buckets") } - // Populate existing buckets to the etcd backend - if globalDNSConfig != nil { - initFederatorBackend(buckets, newObject) - } - logger.FatalIf(initSafeMode(buckets), "Unable to initialize server switching into safe-mode") if globalCacheConfig.Enabled { @@ -392,6 +387,11 @@ func serverMain(ctx *cli.Context) { globalObjLayerMutex.Unlock() } + // Populate existing buckets to the etcd backend + if globalDNSConfig != nil { + initFederatorBackend(buckets, newObject) + } + initDataUsageStats() initDailyLifecycle()