diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index a28475e0e4b1a..91b0e0f1f01a1 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -800,7 +800,6 @@ public function completeChunkedWrite(string $targetPath, string $writeToken): in $this->getCache()->update($stat['fileid'], $stat); } } catch (S3MultipartUploadException|S3Exception $e) { - $this->objectStore->abortMultipartUpload($urn, $writeToken); $this->logger->error( 'Could not complete multipart upload ' . $urn . ' with uploadId ' . $writeToken, [ @@ -808,6 +807,17 @@ public function completeChunkedWrite(string $targetPath, string $writeToken): in 'exception' => $e, ] ); + try { + $this->objectStore->abortMultipartUpload($urn, $writeToken); + } catch (S3Exception $e) { + $this->logger->error( + 'Failed to abort multi-part upload for ' . $urn . ' with uploadId ' . $writeToken, + [ + 'app' => 'objectstore', + 'exception' => $e, + ] + ); + } throw new GenericFileException('Could not write chunked file'); } return $size;