diff --git a/cmd/admin-bucket-handlers.go b/cmd/admin-bucket-handlers.go index f22221d01..8a12aa582 100644 --- a/cmd/admin-bucket-handlers.go +++ b/cmd/admin-bucket-handlers.go @@ -735,7 +735,7 @@ func (a adminAPIHandlers) ImportBucketMetadataHandler(w http.ResponseWriter, r * rpt.SetStatus(bucket, fileName, fmt.Errorf("An Object Lock configuration is present on this bucket, so the versioning state cannot be suspended.")) continue } - if _, err := getReplicationConfig(ctx, bucket); err == nil && v.Suspended() { + if rcfg, _ := getReplicationConfig(ctx, bucket); rcfg != nil && v.Suspended() { rpt.SetStatus(bucket, fileName, fmt.Errorf("A replication configuration is present on this bucket, so the versioning state cannot be suspended.")) continue } diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index d9c6d6011..9593d89ae 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -998,7 +998,7 @@ func replicateObject(ctx context.Context, ri ReplicateObjectInfo, objectAPI Obje object := ri.Name cfg, err := getReplicationConfig(ctx, bucket) - if err != nil { + if err != nil || cfg == nil { replLogOnceIf(ctx, err, "get-replication-config-"+bucket) sendEvent(eventArgs{ EventName: event.ObjectReplicationNotTracked, diff --git a/cmd/bucket-targets.go b/cmd/bucket-targets.go index 149b30d5e..266ce57d5 100644 --- a/cmd/bucket-targets.go +++ b/cmd/bucket-targets.go @@ -428,7 +428,7 @@ func (sys *BucketTargetSys) RemoveTarget(ctx context.Context, bucket, arnStr str if arn.Type == madmin.ReplicationService { // reject removal of remote target if replication configuration is present rcfg, err := getReplicationConfig(ctx, bucket) - if err == nil { + if err == nil && rcfg != nil { for _, tgtArn := range rcfg.FilterTargetArns(replication.ObjectOpts{OpType: replication.AllReplicationType}) { if err == nil && (tgtArn == arnStr || rcfg.RoleArn == arnStr) { sys.RLock() diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index 4e3c2cadb..c5f9f3f8b 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -958,7 +958,7 @@ func (i *scannerItem) applyLifecycle(ctx context.Context, o ObjectLayer, oi Obje var vc *versioning.Versioning var lr objectlock.Retention var rcfg *replication.Config - if i.bucket != minioMetaBucket { + if !isMinioMetaBucketName(i.bucket) { vc, err = globalBucketVersioningSys.Get(i.bucket) if err != nil { scannerLogOnceIf(ctx, err, i.bucket) diff --git a/cmd/site-replication.go b/cmd/site-replication.go index 2bdf1dddf..cc3aeda0f 100644 --- a/cmd/site-replication.go +++ b/cmd/site-replication.go @@ -5781,7 +5781,7 @@ func (c *SiteReplicationSys) startResync(ctx context.Context, objAPI ObjectLayer for _, bi := range buckets { bucket := bi.Name - if _, err := getReplicationConfig(ctx, bucket); err != nil { + if _, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket); err != nil { res.Buckets = append(res.Buckets, madmin.ResyncBucketStatus{ ErrDetail: err.Error(), Bucket: bucket,