mirror of
https://github.com/rclone/rclone.git
synced 2025-06-24 14:01:31 +02:00
onedrive: fix "The upload session was not found" errors
Before this change, sometimes, perhaps on heavily loaded sharepoint servers, uploads would sometimes fail with the error: {"error":{"code":"itemNotFound","message":"The upload session was not found"}} This retries the upload after a 5 second delay up to --low-level-retries times. Fixes #8545
This commit is contained in:
parent
ebcf51336e
commit
b31659904f
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user