Skip to content

Commit 52d322a

Browse files
authored
Merge pull request #58608 from nextcloud/chunked-write-error-logging
fix: improve logging around failed chunked object store uploads
2 parents 50d07d6 + d6f7805 commit 52d322a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,14 +818,24 @@ public function completeChunkedWrite(string $targetPath, string $writeToken): in
818818
$this->getCache()->update($stat['fileid'], $stat);
819819
}
820820
} catch (S3MultipartUploadException|S3Exception $e) {
821-
$this->objectStore->abortMultipartUpload($urn, $writeToken);
822821
$this->logger->error(
823-
'Could not complete multipart upload ' . $urn . ' with uploadId ' . $writeToken,
822+
'Unable to complete multipart upload for "' . $urn . '" (uploadId: "' . $writeToken . '")',
824823
[
825824
'app' => 'objectstore',
826825
'exception' => $e,
827826
]
828827
);
828+
try {
829+
$this->objectStore->abortMultipartUpload($urn, $writeToken);
830+
} catch (S3Exception $e) {
831+
$this->logger->error(
832+
'Unable to abort multipart upload for "' . $urn . '" (uploadId: "' . $writeToken . '") after completion error',
833+
[
834+
'app' => 'objectstore',
835+
'exception' => $e,
836+
]
837+
);
838+
}
829839
throw new GenericFileException('Could not write chunked file');
830840
}
831841
return $size;

0 commit comments

Comments
 (0)