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

b2: fix failed to create file system with application key limited to a prefix

Nick Craig-Wood53aa4b87fd3c
diff --git a/backend/b2/b2.go b/backend/b2/b2.go
index 307a45ea8..a6f45bf13 100644
--- a/backend/b2/b2.go
+++ b/backend/b2/b2.go
@@ -479,12 +479,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
f.setRoot(newRoot)
_, err := f.NewObject(ctx, leaf)
if err != nil {
- if err == fs.ErrorObjectNotFound {
- // File doesn't exist so return old f
- f.setRoot(oldRoot)
- return f, nil
- }
- return nil, err
+ // File doesn't exist so return old f
+ f.setRoot(oldRoot)
+ return f, nil
}
// return an error with an fs which points to the parent
return f, fs.ErrorIsFile