Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: fix upload of single files into buckets without create permission

Nick Craig-Wood151f03378f3a
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index 0ce6f14ed..c6201492c 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -2033,11 +2033,17 @@ func (o *Object) readMetaData(ctx context.Context) (err error) {
if err != nil {
if awsErr, ok := err.(awserr.RequestFailure); ok {
if awsErr.StatusCode() == http.StatusNotFound {
+ // NotFound indicates bucket was OK
+ // NoSuchBucket would be returned if bucket was bad
+ if awsErr.Code() == "NotFound" {
+ o.fs.cache.MarkOK(bucket)
+ }
return fs.ErrorObjectNotFound
}
}
return err
}
+ o.fs.cache.MarkOK(bucket)
var size int64
// Ignore missing Content-Length assuming it is 0
// Some versions of ceph do this due their apache proxies