s3: fix crash if no UploadId in multipart upload
Before this change if the S3 API returned a multipart upload with no UploadId then rclone would crash. This detects the problem and attempts to retry the multipart upload creation. See: https://forum.rclone.org/t/panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/43425
This commit is contained in:
parent
486a10bec5
commit
c16c22d6e1
1 changed files with 7 additions and 0 deletions
|
@ -5711,6 +5711,13 @@ func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectIn
|
||||||
var mOut *s3.CreateMultipartUploadOutput
|
var mOut *s3.CreateMultipartUploadOutput
|
||||||
err = f.pacer.Call(func() (bool, error) {
|
err = f.pacer.Call(func() (bool, error) {
|
||||||
mOut, err = f.c.CreateMultipartUploadWithContext(ctx, &mReq)
|
mOut, err = f.c.CreateMultipartUploadWithContext(ctx, &mReq)
|
||||||
|
if err == nil {
|
||||||
|
if mOut == nil {
|
||||||
|
err = fserrors.RetryErrorf("internal error: no info from multipart upload")
|
||||||
|
} else if mOut.UploadId == nil {
|
||||||
|
err = fserrors.RetryErrorf("internal error: no UploadId in multpart upload: %#v", *mOut)
|
||||||
|
}
|
||||||
|
}
|
||||||
return f.shouldRetry(ctx, err)
|
return f.shouldRetry(ctx, err)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue