Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadRequest expected filesize during file sync in shared folder #762

Closed
JanMalte opened this issue May 28, 2019 · 8 comments
Closed

BadRequest expected filesize during file sync in shared folder #762

JanMalte opened this issue May 28, 2019 · 8 comments
Labels

Comments

@JanMalte
Copy link

JanMalte commented May 28, 2019

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:

@JanMalte JanMalte changed the title BadRequest expected filesize during file sync BadRequest expected filesize during file sync in shared folder Jun 2, 2019
@metaMMA
Copy link

metaMMA commented Jun 18, 2019

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.

@metaMMA
Copy link

metaMMA commented Jun 20, 2019

@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.

@timm2k
Copy link

timm2k commented Sep 11, 2019

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!

@rhazegh
Copy link

rhazegh commented May 23, 2020

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.

@gacpac
Copy link

gacpac commented Jun 30, 2020

@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.

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.

@Luke-Beck
Copy link

@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.

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!

@sequoiasouthpaw
Copy link

Oh man, I have done everything and all combos of editing the nginx configs, php, and default site configs. I thought deleting the db file was the trick and the sync literally teased me to the last 20 MB. I hate how much time I have had to spend on this when solutions like Immich actually listen to the config changes you make and just work. I am months, multiple updates, versions, types of deployments (including a full SQL deployment) and can't seem to get this working. I do think the .db files are a good rabbit hole but NC just keeps being finnicky. That, or there is a bug with the desktop sync client. Might try moving all my files to a phone and trying an upload from mobile to get everything up.

@sequoiasouthpaw
Copy link

Oh man, I have done everything and all combos of editing the nginx configs, php, and default site configs. I thought deleting the db file was the trick and the sync literally teased me to the last 20 MB. I hate how much time I have had to spend on this when solutions like Immich actually listen to the config changes you make and just work. I am months, multiple updates, versions, types of deployments (including a full SQL deployment) and can't seem to get this working. I do think the .db files are a good rabbit hole but NC just keeps being finnicky. That, or there is a bug with the desktop sync client. Might try moving all my files to a phone and trying an upload from mobile to get everything up.

Legit got excited, found that there was a .db-wal file that I removed as well. Sat in excitement as the file closed in on the full 256MB. It finished then I got the exact same error. 413.... Yeah I am lost. It may be one of the other .something files but at this point I don't think it is an issue with my install. Most likely something in my previously migrated data that is messing up the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants