Files not getting synced (413 Request Entity Too Large)

Nextcloud version: 15
Operating system and version: docker image linuxserver/nextcloud
Apache or nginx version: nginx 1.14.2
PHP version: 7.2.13

The issue:

Some files are not getting synced and the Windows client gives me the error

"Server replied "413 Request Entity Too Large" to "PUT https://my_domain/remote.php/dav/uploads/username/XXXXXXXX/YYYYYY" (skipped due to earlier error, trying again in 6 hour(s))
PATH/TO/FILE.bmp

My nextcloud is behind a letsencrypt nginx reverse proxy. I checked there and modified the file size limits in proxy.conf file:

client_max_body_size 10G;
client_body_buffer_size 400M;

After doing this I restarted the letsencrypt container and restarted the sync, which now passed almost all the files. Alas, there are some files left (some bmp, pdf, rar, zip and doc) which are not really too big - 20M, 11M, 15M.

At the same time, If I copy a new file (I tried with a zip file) pretty large (160M) I have no problem getting it synchronized on the server.

So, is there a “flag” set on these files so that they would not sync?

I am having the same problem. Any body have any ideas?

i have the same problem! With mobile device.

If you’ve already tried the usual fixes of changing client_max_body_size in the nginx.conf, as well as the post_max_size and upload_max_filesize in php.ini, and it still doesn’t work. Please see the solution that I posted here: https://github.com/nextcloud/docker/issues/762#issuecomment-504225433

1 Like

Hello,
Where is the file proxy.conf, i have me too an container Letsencrypt/PROXY; Nextcloud;
Regards,
Fab

Hello, i don’t found the file, where is this file ?
i do this :slight_smile:
"You can also enter the container by typing docker exec -it letsencrypt bash and then edit /config/nginx/proxy.conf ".
But not file in my container LetsEncrypt.
please, regards,

What can you see, if you enter the container and use the command ls -lah /config/nginx/?

Hello,
this my result :root@NAS01:~# docker exec -it nginx-letsencrypt bash
bash-5.1# ls -lah /config/nginx/
ls: cannot access ‘/config/nginx/’: No such file or directory
Regards,

Ok, that explains the missing file. You could use the following command in your docker container to see, if there is a file named proxy.conf at all

find / -type f -name "proxy.conf"

Or you could locate any file which has .conf as an ending and see, if any of those point towards nginx

find / -type f -name "*.conf"

Hello,
bash-5.1# find / -type f -name “proxy.conf”
bash-5.1# find / -type f -name “*.conf”
/lib/sysctl.d/00-alpine.conf
/etc/udhcpd.conf
/etc/sysctl.conf
/etc/modprobe.d/aliases.conf
/etc/modprobe.d/i386.conf
/etc/modprobe.d/kms.conf
/etc/modprobe.d/blacklist.conf
/etc/nginx/conf.d/default.conf
/etc/acme.sh/default/account.conf
/etc/acme.sh/fab@xx.fr/nas01xx.fr/nas01xx.fr.csr.conf
/etc/acme.sh/fab@xx.fr/nas01xx.fr/nas01xcloud.xx.fr.conf
/etc/acme.sh/fab@xx.fr/account.conf
/etc/acme.sh/fab@xx.fr/ca/acme-v02.api.letsencrypt.org/ca.conf
/etc/resolv.conf
/etc/ca-certificates.conf
/app/nginx_location.conf
bash-5.1#

Hmm, the most likely file for me, would be the /etc/nginx/conf.d/default.conf one, since there is no proxy.conf

Please could you tell me/us, what guide or what docker repository you were using, to install your Nextcloud Docker?

Hello,
i found my issue, on my container nginx-web, the file is /etc/nginx/nginx.conf and i set client_max_body_… in this file, and now it works fine.
thanks for all
Regards,

1 Like

I’m plagued with the same issue. My Nextcloud Linux dekstop client retries uploading a single 888MB big file again and again and always fails with the error:

Path/of/big-file: Server replied "413 Request Entity Too Large" to "PUT https://my-nextloud-url/remote.php/dav/uploads/my-user/4116002158/0000000000001

My Nextcloud server is running without any docker / virtualization on a Debian Nginx server with php-7.4-fpm setup as instructed by some nextcloud guides.

I’ve adopted my /etc/nginx/nginx.conf to have

client_max_body_size 10G;
client_body_buffer_size 400M;

set to those values.

I’ve added a info.php file (containing phpinfo()) to the www/html folder to tell me that the php.ini file used is /etc/php/7.4/fpm/php.ini - And adapted the values of post_max_size and upload_max_filesize in it.

I’ve tried restarting the nginx and php7.4-fpm services afterwards, but the problem still persists. Strangely, my Android Nextcloud clients has no problem uploading far bigger files than that, which get downloaded to my Linux desktop just fine.

UPDATE: Ah, I just found there is a feature called “Chunked file upload” that seems to have been implemented in the Android app, but not in the Linux desktop client.

UPDATE2: with
grep -ri client_max_body_size /etc/nginx/
I found that the site specific config file in /etc/nginx/sites-available/ still contained a smaller value for client_max_body_size - adapted that to something large enough and restarted nginx again - now the error is gone, nice one! :slight_smile:

1 Like

Hiya,
I’m having the same issue and tried all of suggested fix.
I changed nginx.conf, php.ini, config.php still not wanting to upload any files bigger than 1G

SOLUTION for me:
Added the recommended configuration in nginx and php.
Restarting Nextcloud-Client did NOT help. Completely removed account vom Nextcloud client and adding account again. After that it works!

(I have a bit different configuration: NAT > nginx (reverse proxy) > apache with nextcloud running on it.)

1 Like

Below worked for me:

  • Platform: nextcloud on proxmox
  • file locaiton: /etc/nginx/nginx.conf
  • Open above file using nano editor.
  • change the line client_max_body_size 1M; to client_max_body_size 100M;
  • save file and exit
  • restart nginx server using command: service nginx restart

Thank you for posting this solution, it should be pinned, this one worked for me too