Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunked upload fails when user quota is zero #217

Closed
XA21X opened this issue Oct 10, 2018 · 4 comments
Closed

Chunked upload fails when user quota is zero #217

XA21X opened this issue Oct 10, 2018 · 4 comments

Comments

@XA21X
Copy link

XA21X commented Oct 10, 2018

Steps to reproduce

  1. Set user quota to zero.
  2. Set group folder quota to unlimited.
  3. Upload a file approximately >10MB (?, haven't discovered threshold) into the group folder.

Expected behaviour

Upload progress bar should display and proceed as normal. I expect everything to work as long as the file size is lesser than the configured max upload limit i.e. 511 MB.

Actual behaviour

Upload fails silently.

However, if the user quota is increased such that it is non-zero but still lesser than the file size, the upload fails with a message like 'insufficient quota'.

The error logs indicate that for a small file, it is PUT into the group folder directly. Whereas for larger files requiring chunked transfer, it uses MKCOL to create a temporary folder in the user's directory where the quota is zero. But this shouldn't matter, because as soon as the transfer finishes, it is moved to the group folder and does not require quota from the user.

I haven't had time to investigate this, but I believe that either the temporary chunked uploads should go into some private part of the group folder OR have some way of bypassing the user quota when it is not intended for the user's storage.

Server configuration

Operating system: NixOS 18.03

Web server: Nginx 1.15.0

Database: PostgreSQL 10.4

PHP version: 7.2.10

Nextcloud version: 14.0.0

Logs

These logs are the results from attempting to upload two files. The first 400 KB file succeeds, but the 46 MB file fails silently.

Web server error log

Web server error log
[10/Oct/2018:13:23:38 +0000] "PUT /remote.php/webdav/Media%20Team/3301NotesUpToWeek7.pdf HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"
[10/Oct/2018:13:23:38 +0000] "PROPFIND /remote.php/dav/files/user/Media%20Team/3301NotesUpToWeek7.pdf HTTP/1.1" 207 1180 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"
[10/Oct/2018:13:23:40 +0000] "MKCOL /remote.php/dav/uploads/redacted_user/web-file-upload-52c30823b4db590f0bad4e304c8d22e8-1539177818306 HTTP/1.1" 403 243 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"
[10/Oct/2018:13:23:40 +0000] "DELETE /remote.php/dav/uploads/redacted_user/web-file-upload-52c30823b4db590f0bad4e304c8d22e8-1539177818306 HTTP/1.1" 404 248 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"

Nextcloud log (data/nextcloud.log)

Nextcloud log
10/Oct/2018:13:23:33 +0000 "PUT /remote.php" 201
10/Oct/2018:13:23:38 +0000 "PROPFIND /remote.php" 207
10/Oct/2018:13:23:40 +0000 "MKCOL /remote.php" 403
10/Oct/2018:13:23:40 +0000 "DELETE /remote.php" 404
@XA21X
Copy link
Author

XA21X commented Oct 10, 2018

Just tested with the desktop client and I'm getting the same result:
The item is not synced because of previous errors: Error transferring https://redacted_host/remote.php/dav/uploads/redacted_user/1623990491 - server replied: Forbidden (Could not create directory //1623990491). I highly suspect something's changed in Nextcloud 14, although my installation hasn't been tested with large files since the upgrade, until now that is.

@xinux4d
Copy link

xinux4d commented Oct 26, 2018

Hello,

You can change the chunk size during the upload :

In your databases :

INSERT INTO oc_appconfig (appid, configkey, configvalue) VALUES (‘files’, ‘max_chunk_size’, ‘524288000’);

(to modify to 500 Mb files)

@proxyconcept
Copy link

Should be fixed with this commit nextcloud/server@0fb070b (see nextcloud/server#11485)

@XA21X
Copy link
Author

XA21X commented Oct 29, 2018

@xinux4d Thanks for providing a potential workaround, although I ended up provisioning a small personal quota instead for the short term.

@proxyconcept Applied and can confirm it's working! :)

@XA21X XA21X closed this as completed Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants