Uploading big files fails constantly

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.4.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.1 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • nginx version: nginx/1.24.0 (Ubuntu)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • N/A
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Community Web installer
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Uploading big files with Webdav and Nextcloud client fails from at least Windows and Android devices.

Steps to replicate it (hint: details matter!):

  1. Get a for ex. 5GB file
  2. Start Upload
  3. Wait it to fail

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.
Webdav error
Client error

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:
/var/log/nginx/error.log

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):
occ config:list system

Apps

The output of occ app:list (if possible).
occ app:list

2025/01/03 22:36:47 [error] 1272#1272: *855310 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 91.XX.XX.XX, server: files.myserver.censored, request: "GET /index.php/204 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "files.myserver.censored"

Your NGINX or PHP crashes because the upload takes too long (the default values of nginx and php are too low for such cases). You must increase these timeouts in the PHP and/or web server configuration. For NGINX you can test something like this:

proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

But I don’t know exactly which timeout is triggered here.

If it is due to PHP, you should also see something in the PHP error log.

1 Like

The timeouts you’re hitting are a byproduct of both the timeouts themselves (which as noted can be adjusted in some places) and your overall end-to-end HTTP path throughout.

In addition to what was already noted, you might trying reducing the maximum chunk size in the official Desktop client (search the forum or check the Desktop docs; it’s a client side config parameter).

Since each chunk is sent in its own HTTP transaction, smaller chunk sizes will result in a lower likelihood of triggering end-to-end path timeouts in your infrastructure.

That won’t be an option for your other WebDaV client (unless it happens to support Nextcloud’s chunking which AFAIK WinSCP does not).,