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

onedrive: fix "The upload session was not found" errors

Nick Craig-Woodb31659904fdc
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index bfa6ce61c..c1a13f654 100644
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -2469,6 +2469,10 @@ func (o *Object) uploadFragment(ctx context.Context, url string, start int64, to
return false, nil
}
return true, fmt.Errorf("retry this chunk skipping %d bytes: %w", skip, err)
+ } else if err != nil && resp != nil && resp.StatusCode == http.StatusNotFound {
+ fs.Debugf(o, "Received 404 error: assuming eventual consistency problem with session - retrying chunk: %v", err)
+ time.Sleep(5 * time.Second) // a little delay to help things along
+ return true, err
}
if err != nil {
return shouldRetry(ctx, resp, err)