I'm using nextcloud docker image behind the https://github.com/jwilder/nginx-proxy
Using the nextcloud-desktop client to sync my files, I'm getting a BadRequest response for larger files. The file is about 25M. This only happens if the folder is shared.
Exception
Sabre\DAV\Exception\BadRequest: expected filesize 2547745 got 1982464
#10 dav/lib/Connector/Sabre/File.php(222): put
#9 dav/lib/Connector/Sabre/Directory.php(156): createFile
#8 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(1096): createFile
#7 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(525): httpPut
#6 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(0): call_user_func_array
#5 /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): emit
#4 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(479): invokeMethod
#3 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(254): exec
#2 dav/lib/Server.php(316): exec
#1 dav/appinfo/v2/remote.php(35): require_once
#0 /var/www/html/remote.php(163): null
Headers
Accept | */*
Accept-Encoding | gzip, deflate
Accept-Language | de-DE,en,*
Authorization | [Filtered]
Connection | close
Content-Length | 2547745
Content-Type | application/octet-stream
Host | cloud.gegl-group.eu
Oc-Async | 1
Oc-Chunk-Size | 10000000
Oc-Total-Length | 2547745
User-Agent | Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)
X-Forwarded-For | 87.122.193.5
X-Forwarded-Port | 443
X-Forwarded-Proto | https
X-Forwarded-Ssl | on
X-Oc-Mtime | 1558985473
X-Real-Ip | 87.122.193.5
X-Request-Id | e646d7fa-843d-4d08-8223-886235bfcd4b
The client_max_body_size is already set to 10G for the nginx-proxy and the nextcloud-web nginx server.
This is maybe related or duplicate of:
I'm also having an issue with the nextcloud docker container. I've tried all of the suggested fixes (changing client_max_body_size in the nginx.conf, as well as the post_max_size and upload_max_filesize in php.ini). I created test files of 10MB and 10MB+1kB. The first went through fine, but the second was rejected with a 413 http code. No errors in the logs, though.
@JanMalte
I finally solved my issue regarding 413 response with files over 10mb. I'm not sure if it'll help you but I fixed my issue by editing the proxy.conf file for my letsencrypt container. It can be found in your appdata directory at~/appdata/letsencrypt/nginx/proxy.conf.
You can also enter the container by typing docker exec -it letsencrypt bash and then edit /config/nginx/proxy.conf.
The first line in this file reads client_max_body_size 10m;. Change the 10m to the size you desire. Then restart the letsencrypt container via docker restart letsencrypt and that should fix the issue.
I've seen these errors too. I think this is a issue at the sync client. It seems the local database of sync clients has wrong entries for related files. The error disappeared after removing ._sync*.db file. Do not forget to shutdown sync client first!
Removing ._sync*.db fixed it for me.
This file is located in the Nextcloud folder where you put your files to be synced with server.
@JanMalte
I finally solved my issue regarding 413 response with files over 10mb. I'm not sure if it'll help you but I fixed my issue by editing theproxy.conffile for my letsencrypt container. It can be found in yourappdatadirectory at~/appdata/letsencrypt/nginx/proxy.conf.You can also enter the container by typing
docker exec -it letsencrypt bashand then edit/config/nginx/proxy.conf.The first line in this file reads
client_max_body_size 10m;. Change the10mto the size you desire. Then restart the letsencrypt container viadocker restart letsencryptand that should fix the issue.
Looks like that fixed it for me. Although it's kind of weird that problem, because it wasn't an issue in older versions of nextcloud client.
@JanMalte
I finally solved my issue regarding 413 response with files over 10mb. I'm not sure if it'll help you but I fixed my issue by editing theproxy.conffile for my letsencrypt container. It can be found in yourappdatadirectory at~/appdata/letsencrypt/nginx/proxy.conf.You can also enter the container by typing
docker exec -it letsencrypt bashand then edit/config/nginx/proxy.conf.The first line in this file reads
client_max_body_size 10m;. Change the10mto the size you desire. Then restart the letsencrypt container viadocker restart letsencryptand that should fix the issue.
Thanks, this got me on the right track.
My issue was that I was running nextcloud through an nginx reverse proxy and that proxy didn't have a value assigned to client_max_body_size so its default was 1m.
After changing it to match the values I've setting in the nextcloud configs I am now able to upload large files!
Most helpful comment
I've seen these errors too. I think this is a issue at the sync client. It seems the local database of sync clients has wrong entries for related files. The error disappeared after removing ._sync*.db file. Do not forget to shutdown sync client first!