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

internxt: fix server-side directory move failing after a gateway timeout

Nick Craig-Wood0c52b183d018
diff --git a/backend/internxt/internxt.go b/backend/internxt/internxt.go
index a2b985b6b..ba4bfc30c 100644
--- a/backend/internxt/internxt.go
+++ b/backend/internxt/internxt.go
@@ -1033,6 +1033,11 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
encodedLeaf := f.opt.Encoding.FromStandardName(dstLeaf)
err = f.pacer.Call(func() (bool, error) {
err := folders.MoveFolder(ctx, f.cfg, srcID, dstDirectoryID, encodedLeaf)
+ // Moving a large folder can outlast the gateway timeout (520/502)
+ // yet still complete, in which case the retry reports this.
+ if err != nil && isConflictError(err) && strings.Contains(err.Error(), "already moved to that location") {
+ return false, nil
+ }
return f.shouldRetry(ctx, err)
})
if err != nil {