diff --git a/cmd/erasure-multipart.go b/cmd/erasure-multipart.go index a7f531abb..5a5c19e33 100644 --- a/cmd/erasure-multipart.go +++ b/cmd/erasure-multipart.go @@ -1248,7 +1248,11 @@ func (er erasureObjects) CompleteMultipartUpload(ctx context.Context, bucket str } } - defer er.deleteAll(context.Background(), minioMetaMultipartBucket, uploadIDPath) + defer func() { + if err == nil { + er.deleteAll(context.Background(), minioMetaMultipartBucket, uploadIDPath) + } + }() // Rename the multipart object to final location. onlineDisks, versionsDisparity, err := renameData(ctx, onlineDisks, minioMetaMultipartBucket, uploadIDPath, diff --git a/cmd/object-multipart-handlers.go b/cmd/object-multipart-handlers.go index aeb7952e0..b7255ab4e 100644 --- a/cmd/object-multipart-handlers.go +++ b/cmd/object-multipart-handlers.go @@ -1075,8 +1075,13 @@ func (api objectAPIHandlers) AbortMultipartUploadHandler(w http.ResponseWriter, } opts := ObjectOptions{} if err := abortMultipartUpload(ctx, bucket, object, uploadID, opts); err != nil { - writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) - return + switch err.(type) { + case InvalidUploadID: + // Do not have return an error for non-existent upload-id + default: + writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) + return + } } writeSuccessNoContent(w)