From 0c52b183d0185c120e2487513d953b3e73d16f6f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 23 Sep 2026 12:31:22 +0100 Subject: [PATCH] internxt: fix server-side directory move failing after a gateway timeout Moving a directory can take longer than the API gateway allows, so the request fails with a 520 or 502 error even though the move completes. The retry then failed with "Folder ... was already moved to that location (status 409)". Treat that error as success. --- backend/internxt/internxt.go | 5 +++++ 1 file changed, 5 insertions(+) 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 {