diff --git a/cmd/gateway.go b/cmd/gateway.go index a5f363ec36ca..82775d317557 100644 --- a/cmd/gateway.go +++ b/cmd/gateway.go @@ -20,6 +20,8 @@ package cmd import ( + "context" + "errors" _ "net/http/pprof" "os" "os/signal" @@ -140,6 +142,12 @@ func gateway(c *cli.Context) error { return err } + if _, err := jfsGateway.GetBucketInfo(context.Background(), minio.MinioMetaBucket); errors.As(err, &minio.BucketNotFound{}) { + if err := jfsGateway.MakeBucketWithLocation(context.Background(), minio.MinioMetaBucket, minio.BucketOptions{}); err != nil { + logger.Fatalf("init MinioMetaBucket error %s: %s", minio.MinioMetaBucket, err) + } + } + args := []string{"server", "--address", listenAddr, "--anonymous"} if c.Bool("no-banner") { args = append(args, "--quiet")