Merge pull request #58608 from nextcloud/chunked-write-error-logging

fix: improve logging around failed chunked object store uploads
This commit is contained in:
Stephan Orbaugh 2026-06-09 17:25:19 +02:00 committed by GitHub
commit 52d322aac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -818,14 +818,24 @@ class ObjectStoreStorage extends Common implements IChunkedFileWrite {
$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,
'Unable to complete multipart upload for "' . $urn . '" (uploadId: "' . $writeToken . '")',
[
'app' => 'objectstore',
'exception' => $e,
]
);
try {
$this->objectStore->abortMultipartUpload($urn, $writeToken);
} catch (S3Exception $e) {
$this->logger->error(
'Unable to abort multipart upload for "' . $urn . '" (uploadId: "' . $writeToken . '") after completion error',
[
'app' => 'objectstore',
'exception' => $e,
]
);
}
throw new GenericFileException('Could not write chunked file');
}
return $size;