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

opendrive: fix List on a just deleted and remade directory

Nick Craig-Wooddb37b3ef9e23
diff --git a/backend/opendrive/opendrive.go b/backend/opendrive/opendrive.go
index 263daa223..0b0ee2e9d 100644
--- a/backend/opendrive/opendrive.go
+++ b/backend/opendrive/opendrive.go
@@ -767,6 +767,17 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
return f.shouldRetry(ctx, resp, err)
})
if err != nil {
+ if apiError, ok := err.(*Error); ok {
+ // Work around a bug maybe in opendrive or maybe in rclone.
+ //
+ // We should know whether the folder exists or not by the call to
+ // FindDir above so exactly why it is not found here is a mystery.
+ //
+ // This manifests as a failure in fs/sync TestSyncOverlapWithFilter
+ if apiError.Info.Message == "Folder is already deleted" {
+ return fs.DirEntries{}, nil
+ }
+ }
return nil, fmt.Errorf("failed to get folder list: %w", err)
}