Hi Nextcloud community
I found IMHO an inconsistency between how the Nextcloud desktop client and server are handling chunked file uploads:
- The Nextcloud server configuration suggests a maximal file/chunk size upload of 512 MB as can be seen in the nginx configuration template in https://docs.nextcloud.com/server/23/admin_manual/installation/nginx.html#nextcloud-in-the-webroot-of-nginx (see parameter client_max_body_size) and also is configured by default to the docker image (docker/Dockerfile at c046638a989032c3fbea02b40b5af8fc1eb3c9d7 · nextcloud/docker · GitHub)
- The newer Nextcloud desktop client generation (> 3.0?) is using a dynamic chunk size if the server is indicating chunked upload support in its capabilities. The maximal chunk size can go up to 1000 MB (https://github.com/nextcloud/desktop/blob/v3.4.1/src/libsync/syncoptions.h#L64) based on the connection speed of the upload.
What happens now is that for fast upload connections, the chunk size is increased over 512 MB, which then causes the (in my case) nginx server to close the connection for the uploaded chunk. This in turn leads the client to fail the file upload (, until the client is restarted? for another try).
From my point of view, there are different approaches to solve this issue:
- The client should retry the failed chunk upload with the most recent successfully uploaded chunk size, hence the client’s error handing should be improved
- Nextcloud client and server should implicitly (both using the same maximal chunk file size in their respective configuration files and documentation) or explicitly (agreement of the same maximal chunk file size e.g. via capabilities API?) communicate and agree upon the maximal chunk file size
The advantage of the first approach would be, that the client would also become more robust with any other transparent intermediate boxes that would limit the maximal upload chunk file size.
What do you think? How do we proceed from here?
Thanks for your inputs