[SOLVED] "unknown error" when uploading in web app / "413 Request Entity Too Large" when uploading through webdav

Dear community,
just wanted to share this finding including solution :wink:
Since a while I had the problem when uploading abitrary files through the files (web) app I got the error fly-in: “unknown error”. Obviously, noone knows what the error is :rofl:
Recently I tried the same with a webdav client (winscp) which finally gave me a more pleasant error message: " 413 Request Entity Too Large"
With I went on googling finding: https://www.keycdn.com/support/413-request-entity-too-large
I am using nginx and the webiste suggests adding “client_max_body_size 100M” to your nginx-conf.
I searched for this entry in my nginx configs and saw that this entry was commented out (“#”) in my nextcloud nginx-conf :thinking:
Setting it as follows did solve it for me:

location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+).php(?:$|\/) {
fastcgi_split_path_info ^(.+?.php)(\/.*|)$;
try_files $fastcgi_script_name =404;
include fastcgi_params;
include php_optimization.conf;
fastcgi_pass php-handler;
fastcgi_param HTTPS on;
client_max_body_size 10240M;
}

I hopy this helps all people with the same issue!

Cheers.

3 Likes

I’ve got the same error but with apache server instead of NGINX. Any solution for this one?

I got this error although I uploaded a lot of large files. Only with one PDF 132MB I get the error and only if I use the in-build nextcloud davs:// folder in Ubuntu Filemanager. (Ubuntu 21.04)

I also tried renaming the file and uploading it again, also into another folder, but the same error.

If I use the Nextcloud Application to syncronize my local Nextcloud folder it syncs the very same PDF file just fine.

It came out, that I also have client_max_body_size 100m in my nginx config.
After changing the nginx config to client_max_body_size 10000m I could upload the 132MB file fine via davs too (up to 10GB I hope now)

Strange, that it seems like the Nextcloud Application is using another mechanism, that doesn’t involve nginx???

1 Like