From f8039deb7c9f6df909ecc89c6b681c278352522d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 22 Apr 2020 18:01:59 +0100 Subject: [PATCH] s3: fix detection of BucketAlreadyOwnedByYou and BucketAlreadyExists error This was being silently ignored until this commit e2bf91452a263ff8 s3: report errors on bucket creation (mkdir) correctly --- backend/s3/s3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 9bd4dbcb7..1353fd666 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -1733,8 +1733,8 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error { if err == nil { fs.Infof(f, "Bucket %q created with ACL %q", bucket, f.opt.BucketACL) } - if err, ok := err.(awserr.Error); ok { - if err.Code() == "BucketAlreadyOwnedByYou" { + if awsErr, ok := err.(awserr.Error); ok { + if code := awsErr.Code(); code == "BucketAlreadyOwnedByYou" || code == "BucketAlreadyExists" { err = nil } }