resolve #61488#61594
Open
0x7d8 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Robert Jansen <me@rjns.dev>
Author
Author
|
I assume backport would apply to this, for what versions? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On primary object storage (S3 and other object stores) with a finite per-user
quota, chunked uploads fail with HTTP 413
EntityTooLarge/ "Insufficientspace" regardless of how much quota is actually free. A ~250 MB upload was
rejected with ~8.4 GiB of free quota; reducing the chunk size had no effect,
and setting the quota to
Unlimitedworked around it.Root cause is in
OC\Files\Storage\Wrapper\Quota::writeStream(). Chunk partsare written to the quota-exempt
uploads/path, for whichfree_space()returns the wrapped storage's value. Object stores return
FileInfo::SPACE_UNLIMITED(-3) there, so theif ($size < $free)checkevaluates
$size < -3, which is always false, and the method throwsNotEnoughSpaceException.writeStream()was the only write method missing the$free < 0short-circuitthat
file_put_contents(),copy(),copyFromStorage(), andmoveFromStorage()already use, and thatQuotaPlugin::checkQuota()applies atthe DAV layer. The fix adds that guard. On local storage the bug does not
trigger because
free_space()returns a real positive value for the uploadspath.
Checklist
3. to review, feature component)stable32)AI (if applicable)