Nextcloud uploads end with unknown error

The Basics

  • Nextcloud Server version
    • 31.0.8
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.3 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • nginx 1.24.0
  • 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?
    • One Upload failed with this error in the log: Fehler no app in context BadRequest Erwartete Dateigröße von 23351705 bytes, aber 20217856 bytes gelesen (vom Nextcloud-Client) und geschrieben (in den Nextcloud-Speicher). Dies kann entweder ein Netzwerkproblem auf der sendenden Seite oder ein Problem beim Schreiben in den Speicher auf der Serverseite sein.
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • HyperV VM hosted on Windows Server 2022
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • yes CloudFlare

Summary of the issue you are facing:

[Since this one error i can’t upload files bigger than 40kb]

Log entries

Fehler
no app in context
BadRequest
Erwartete Dateigröße von 23351705 bytes, aber 20217856 bytes gelesen (vom Nextcloud-Client) und geschrieben (in den Nextcloud-Speicher). Dies kann entweder ein Netzwerkproblem auf der sendenden Seite oder ein Problem beim Schreiben in den Speicher auf der Serverseite sein.

Only this when the first bigger upload failed and the other uploads after the first one didn’t get logged. It just said unknow error in a popup in the top right.

I have basically tried everything, but I don’t know why or how this error started, or even how to fix it.

The Log below is from Nginx when i tried to upload a file to Nextcloud.

162.158.217.5 - - [06/Sep/2025:11:54:43 +0200] "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1" 200 148 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:54:43 +0200] "MKCOL /remote.php/dav/uploads/Leo/web-file-upload-27302d2cbf475dd1 HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:54:57 +0200] "DELETE /remote.php/dav/uploads/Leo/web-file-upload-27302d2cbf475dd1 HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:54:57 +0200] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:55:02 +0200] "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1" 200 148 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:55:27 +0200] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:55:57 +0200] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
162.158.217.5 - - [06/Sep/2025:11:56:09 +0200] "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1" 200 148 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/53"

Update: I have reinstalled Nextcloud from scratch on a fresh Ubuntu Server, but I am still encountering the same error. I’m not sure what’s causing it and would appreciate any help.

There are numerous possibilities, but you didn’t fully fill out the support template so we can only take a guess.

Some things to check/try:

  • Disable proxying via Cloudflare (DNS only)
  • Are you using the files_antivirus app by chance?
  • You mentioned both a VM and Nginx. Is this is an Archive-based install or using one of the Nextcloud VM images?
  • Are you using the Nginx config from the Nextcloud Admin Manual for v31 or from some other source?
  • Please monitor your browser inspector Network tab while reproducing the behavior. Same for the Console tab.

Something definitely doesn’t look right. Your web server logs should have a MKCOL followed immediately by a PUT (the actual file transfer). The DELETE (after ~10 seconds) suggests the client is giving up and maybe something - such as Cloudflare or a WAF or body size limit on a web or in the path is blocking things.

1 Like

This may be the beginning of a diagnosis, I encountered this error 2 years ago. Cloudflare limits its speeds depending on the type of your subscription

I deduce that if your NC server uses the ClouFlare DNS that you normally modify at your registrar, in addition to having registered your FQDN with ClouFlare, I think that you are subject to their limits.

Hello,
thanks for all your responses.
I disabled the Cloudflare proxy, but it still didn’t work.
Then I reproduced the error and took screenshots of the logs from Chrome DevTools.


  • Are you using the files_antivirus app by chance? – No
  • You mentioned both a VM and Nginx. Is this is an Archive-based install or using one of the Nextcloud VM images? – I installed the VM from scratch.
  • Are you using the Nginx config from the Nextcloud Admin Manual for v31 or from some other source? – * I originally used it, but have switched to Apache2 yesterday.