NC app: Timeouts while assembling chunks on external storage #12665

My Nextcloud instance is backed by a (slow) external storage.
When I upload files bigger than 39MB via the current NC app, they will be chunked. The chunks will be saved to a temporary folder on the web server (not external storage).
After the upload reaches 100%, the chunks are assembled on my external storage with MOVE
After roughly 30 seconds the NC App throws an error: An error occured while waiting on the server...
In the background the file is still assembled on the external storage. The App correctly realizes after a while the file is actually there and marks the upload as completed (Same file found on remote. Skipping upload.)

I dont run into any timeout / file size issues when I use:

  • Web Client on an external storage folder
  • NC App on a folder directly on the web server (no external storage)

Also my nginx logs show that the client (App) closes the connection when the error is shown on the App. Iam convinced this has nothing to do with the usual time out issues of big files.

I assume:

  1. NC app has a fixed timeout for responses of operations on the server, e.g. MOVE. Since the server is still busy assembling the chunks, no response is send to the App and the timeout is triggered.
  2. There is no way to disable server-side chunking for files uploaded by the app.

Maybe someone here has some ideas how to:

  1. Disable / change chunking of uploads from the NC app. Preferably on the server-side.
    Similiar to config:app:set files max_chunk_size --value 0 which doesn’t affect chunking by the app.
    In the source code of the app one can find a check for CHUNK_SIZE_MOBILE, but I can’t figure out where this is coming from or if it could be adjusted externally (without modifying and building the source).

  2. Increase timeout for operations by the app on the server. The usual increases of timeouts and file sizes are show no effect on this issue:

client_max_body_size 4G;
client_body_timeout 3600;
send_timeout 3600;
client_body_temp_path /tmp 1;
fastcgi_buffers 64 4K;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_connect_timeout 3600;
fastcgi_max_temp_file_size 0;
proxy_buffering off;
fastcgi_request_buffering off;
1 Like