How to solve the "Unknown error during upload" error when uploading files larger than 2GB

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 10 (31.0.6)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04
  • Web server and version (e.g, Apache 2.4.25):
    • nginx/1.18.0
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx/1.18.0
  • PHP version (e.g, 8.3):
    • 8.3
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When uploading files larger than 2GB to the main folder using any channel, an “Unknown error occurred” error message will appear

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

  1. Go to the files page
  2. Click the Upload button and select the 3.30GB .MKV file
  3. An error message appears after the upload progress bar finishes

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.

{"reqId":"MXndW0oAbv0lurDd1YIZ","level":3,"time":"2025-07-09T17:37:20+00:00","remoteAddr":"HIDE","user":"xx54876666","app":"no app in context","method":"MOVE","url":"/remote.php/dav/uploads/xx54876666/web-file-upload-ed17f986ece5140c/.file","message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36","version":"31.0.6.2","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Upload/AssemblyStream.php","line":279,"function":"get","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/AssemblyStream.php","line":152,"function":"getStream","class":"OCA\\DAV\\Upload\\AssemblyStream","type":"->"},{"function":"stream_read","class":"OCA\\DAV\\Upload\\AssemblyStream","type":"->"},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php","line":55,"function":"fread"},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php","line":96,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->"},{"function":"stream_read","class":"Icewind\\Streams\\CallbackWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Local.php","line":302,"function":"file_put_contents"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Local.php","line":584,"function":"file_put_contents","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":215,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":325,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":151,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":181,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":77,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":59,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":603,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":400,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":469,"message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","exception":[],"CustomMessage":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在"},"id":"686ec68dbf8ff"}
{"reqId":"MXndW0oAbv0lurDd1YIZ","level":3,"time":"2025-07-09T17:37:21+00:00","remoteAddr":"HIDE","user":"xx54876666","app":"webdav","method":"MOVE","url":"/remote.php/dav/uploads/xx54876666/web-file-upload-ed17f986ece5140c/.file","message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36","version":"31.0.6.2","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Upload/AssemblyStream.php","line":279,"function":"get","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/AssemblyStream.php","line":152,"function":"getStream","class":"OCA\\DAV\\Upload\\AssemblyStream","type":"->"},{"function":"stream_read","class":"OCA\\DAV\\Upload\\AssemblyStream","type":"->"},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php","line":55,"function":"fread"},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php","line":96,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->"},{"function":"stream_read","class":"Icewind\\Streams\\CallbackWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Local.php","line":302,"function":"file_put_contents"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Local.php","line":584,"function":"file_put_contents","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":215,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":325,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":151,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":181,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":77,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":59,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":603,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":400,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":469,"message":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在","exception":[],"CustomMessage":"無法開啟檔案:web-file-upload-ed17f986ece5140c/18,檔案似乎不存在"},"id":"686ec68dbf8d0"}

Web server / Reverse Proxy

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

2025/07/09 17:25:04 [error] 958#958: *5 upstream timed out (110: Unknown error) while reading response header from upstream, client: HIDE, server: HIDE, request: "MOVE /remote.php/dav/uploads/xx54876666/web-file-upload-15c689cb0dba81f1/.file HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "HIDE"
2025/07/09 17:37:16 [error] 958#958: *230 upstream timed out (110: Unknown error) while reading response header from upstream, client: HIDE, server: HIDE, request: "MOVE /remote.php/dav/uploads/xx54876666/web-file-upload-ed17f986ece5140c/.file HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "HIDE"
2025/07/09 17:49:26 [error] 958#958: *230 upstream timed out (110: Unknown error) while reading response header from upstream, client: HIDE, server: HIDE, request: "GET /settings/ajax/checksetup HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "HIDE"
2025/07/09 18:00:21 [error] 958#958: *952 upstream timed out (110: Unknown error) while reading response header from upstream, client: HIDE, server: HIDE, request: "GET /settings/ajax/checksetup HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "HIDE"
2025/07/09 19:34:53 [error] 958#958: *2391 upstream timed out (110: Unknown error) while reading response header from upstream, client: HIDE, server: HIDE, request: "GET /settings/ajax/checksetup HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock", host: "HIDE"

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!):

  'overwrite.cli.url' => 'HIDE',
  'dbname' => 'HIDE',
  'dbhost' => 'HIDE',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'HIDE',
  'dbpassword' => 'HIDE',
  'installed' => true,
);

Tips for increasing the likelihood of a response

This is my php-fpm config

upload_max_filesize = 51200M
post_max_size = 51200M
max_file_uploads = 100

This is my nginx config

upstream php-handler {
    server unix:/run/php/php8.3-fpm.sock;
}

server {
    listen 80;
    listen [::]:80;
    server_name HIDE;

    server_tokens off;

    return 301 https://$server_name$request_uri;
}

server {
    listen 443      ssl http2;
    listen [::]:443 ssl http2;
    server_name HIDE;

    root /var/www/nextcloud;

    ssl_certificate /etc/letsencrypt/live/HIDE/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/HIDE/privkey.pem;

    server_tokens off;

    client_max_body_size 51200M;
    client_body_timeout 300s;
    fastcgi_buffers 128 4K;


    client_body_buffer_size 512k;

    
    add_header Referrer-Policy                   "no-referrer"       always;
    add_header X-Content-Type-Options            "nosniff"           always;
    add_header X-Frame-Options                   "SAMEORIGIN"        always;
    add_header X-Permitted-Cross-Domain-Policies "none"              always;
    add_header X-Robots-Tag                      "noindex, nofollow" always;
    add_header X-XSS-Protection                  "1; mode=block"     always;

    
    fastcgi_hide_header X-Powered-By;

    include mime.types;
    types {
        text/javascript mjs;
	application/wasm wasm;
    }


    index index.php index.html /index.php$request_uri;

    location = / {
        if ( $http_user_agent ~ ^DavClnt ) {
            return 302 /remote.php/webdav/$is_args$args;
        }
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ^~ /.well-known {

        location = /.well-known/carddav { return 301 /remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /remote.php/dav/; }

        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }
        
        return 301 /index.php$request_uri;
    }


    location ~ \.php(?:$|/) {

        rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        set $path_info $fastcgi_path_info;

        try_files $fastcgi_script_name =404;

        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $path_info;
        fastcgi_param HTTPS on;

        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;

        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;

        fastcgi_max_temp_file_size 0;
    }

    location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
        try_files $uri /index.php$request_uri;

        add_header Cache-Control                     "public, max-age=15778463";
        add_header Referrer-Policy                   "no-referrer"       always;
        add_header X-Content-Type-Options            "nosniff"           always;
        add_header X-Frame-Options                   "SAMEORIGIN"        always;
        add_header X-Permitted-Cross-Domain-Policies "none"              always;
        add_header X-Robots-Tag                      "noindex, nofollow" always;
        add_header X-XSS-Protection                  "1; mode=block"     always;
        access_log off;
    }

    location ~ \.(otf|woff2?)$ {
        try_files $uri /index.php$request_uri;
        expires 7d;
        access_log off;
    }

    location /remote {
        return 301 /remote.php$request_uri;
    }

    location / {
        try_files $uri $uri/ /index.php$request_uri;
    }
}

Hi, think you have to increase upload_max_filesize in php.ini

@Andi29 Yes, I have configured php.ini as described in the content, but the error message still appears

upload_max_filesize = 51200M
post_max_size = 51200M
max_file_uploads = 100

try to change your value from 51200M to 10G; then restart your webserver

@Andi29 Thank you for your reply, but I have tried to change the value, the result is still the same

here you get a file, try out and change your php-version and instead apache2 your nginx
ALL - php7.2 - php7.3 - php7.4 memory increase decrease -nextcloud memory_limit post_max_size upload_max_filesize.pdf (26,4 KB)

another posibility, try chatgpt.
Good Luck!
ps: don´t forget to insert your php-version and your webserver