Skip to content

fix(s3): improve error on move/copy operations when bucket quota exceeded#59939

Open
mejo- wants to merge 1 commit into
masterfrom
fix/s3_quota_exceeded_error_message
Open

fix(s3): improve error on move/copy operations when bucket quota exceeded#59939
mejo- wants to merge 1 commit into
masterfrom
fix/s3_quota_exceeded_error_message

Conversation

@mejo-
Copy link
Copy Markdown
Member

@mejo- mejo- commented Apr 27, 2026

Fixes: #58801

Screenshots

Before After
image image

Checklist

AI (if applicable)

  • AI was used to understand the context, but code changes were done on my own and verified by stepping through with the debugger

@mejo- mejo- added this to the Nextcloud 34 milestone Apr 27, 2026
@mejo- mejo- requested a review from icewind1991 April 27, 2026 16:04
@mejo- mejo- self-assigned this Apr 27, 2026
@mejo- mejo- requested review from a team and skjnldsv as code owners April 27, 2026 16:04
@mejo- mejo- added the bug label Apr 27, 2026
@mejo- mejo- removed the request for review from a team April 27, 2026 16:04
@mejo- mejo- requested review from susnux and szaimen April 27, 2026 16:04
@mejo- mejo- requested review from artonge, leftybournes and nfebe and removed request for a team April 27, 2026 16:04
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Apr 27, 2026
private function isStorageFullException(\Throwable $e) {
while ($e !== null) {
if ($e instanceof AwsException) {
// MinIO: dedicated error code for storage-full
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mejo- mejo- force-pushed the fix/s3_quota_exceeded_error_message branch from 238192d to 957e811 Compare April 27, 2026 16:23
@mejo- mejo- force-pushed the fix/files_move_or_copy_no_axios branch from 12b05e8 to 9020324 Compare April 27, 2026 16:34
@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Productivity team Apr 27, 2026
Base automatically changed from fix/files_move_or_copy_no_axios to master April 27, 2026 17:40
…eded

Fixes: #58801

Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- force-pushed the fix/s3_quota_exceeded_error_message branch from 957e811 to 8a12a79 Compare April 27, 2026 17:47
@szaimen szaimen requested review from cuppett and joshtrichards and removed request for szaimen April 30, 2026 12:37
Copy link
Copy Markdown
Contributor

@cuppett cuppett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

2 participants