fix(s3): improve error on move/copy operations when bucket quota exceeded#59939
fix(s3): improve error on move/copy operations when bucket quota exceeded#59939mejo- wants to merge 1 commit into
Conversation
| private function isStorageFullException(\Throwable $e) { | ||
| while ($e !== null) { | ||
| if ($e instanceof AwsException) { | ||
| // MinIO: dedicated error code for storage-full |
There was a problem hiding this comment.
I was only able to test this with rustfs so far. The MinIO error code is taken from the MinIO code search.
Would be good to put a breakpoint here and debug with AWS S3 and other S3 providers if possible, in order to find out their exact error code/message and adjust the conditions here.
There was a problem hiding this comment.
Amazon S3 buckets have no maximum size or object count limit.
There is an EntityTooLarge error for individual PutObject requests > 5GB. Multipart uploads can be up to 50TB now.
238192d to
957e811
Compare
12b05e8 to
9020324
Compare
…eded Fixes: #58801 Signed-off-by: Jonas <jonas@freesources.org>
957e811 to
8a12a79
Compare
cuppett
left a comment
There was a problem hiding this comment.
Recommend a more generic/re-usable UI error message.
Think we can defer finding additional, specific full/quota/limit errors and accumulate those over time given how many S3 providers could be used here (Ceph, Wasabi, QNAP QuObjects, etc.)
| if (error.response?.status === 412) { | ||
| throw new HintException(t('files', 'A file or folder with that name already exists in this folder')) | ||
| } else if (error.response?.status === 413) { | ||
| throw new HintException(t('files', 'Insufficient storage, quota exceeded')) |
There was a problem hiding this comment.
I would recommend the error here being "file too large" versus quota specifically. The conditions we're adding here are for bucket quota, but also bubbling "EntityTooLarge" which could happen under multiple, future conditions. This message is a lot more re-usable just indicating a size issue in general.
| private function isStorageFullException(\Throwable $e) { | ||
| while ($e !== null) { | ||
| if ($e instanceof AwsException) { | ||
| // MinIO: dedicated error code for storage-full |
There was a problem hiding this comment.
Amazon S3 buckets have no maximum size or object count limit.
There is an EntityTooLarge error for individual PutObject requests > 5GB. Multipart uploads can be up to 50TB now.
Fixes: #58801
Screenshots
Checklist
3. to review, feature component)stable32)AI (if applicable)