Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 2554891

For the entries you provided, my .htaccess and .user.ini are similar. Config also.

You could try some testing without SSL to see if the problem happens. 2.4 MB is a surprisingly low threshold for the problem to occur, unless your upload speed it severely limited and it is a timeout issue of some sort.

You could also try testing it using a webdav client connection, instead of a web browser connection. Note the slightly different path for that. I believe that takes PHP out of the equation.

My guess is that Owncloud would not be a solution unless randomly so! Good luck, sorry I can’t be of more help.

I looked over my install notes … I found this one, can’t remember why, but you might try it:

Check config of pdo_mysql.ini at /usr/local/etc/php/ext-30-pdo_mysql.ini
had to increase php memory to 512.

Hi, thanks for replying

I have tried with webdav clients on linux, android and freebsd. I don’t think there’s any getting round php as (I think, might be wrong) dav in nextcloud is mediated by Sabre which is itself php. i’ll try disabling https later (this is problematic because HSTS is enabled)

I think you’re right in that owncloud wouldn’t be a solution as that also uses Sabre and from what I’ve read, it’s this part of it that appears to be the issue.

all that /usr/local/etc/php/ext-30-pdo_mysql.ini has in it is the following:

edit: might be specified in php.ini so will have a look there

yeah, sorry… that’s what’s in mine too. I’m not sure what I was referring to. Ignore!

ok, took off ssl, same result. Also loaded a minimalist httpd.conf, same result.
Next step is to grab latest nextcloud from themselves, move the old nextcloud dir over and start again. i’ll prob need to create a new db as well

I also spun up an ubuntu 18.10 vm and ran the snap install and this did not have this problem. 18.04 has its own issues installing as a vm (python/curtin errors) so that wasn’t tested as I have no bare hardware available right now.

ok - can confirm this happens in a brand new install in a brand new directory without ssl with a basic httpd config and a new mysql database on freebsd-12. only other thing to check i guess is my.cnf

edit; download was directly

and it still fails :frowning:

tried with sqlite instead of mysql56-server - still fails, same error. Expected filesize differs if a different file is chosen.

Hello … forum was down for a day! I think I found the answer, it worked for my user anyway.

I added this to my vhost apache .conf and the problem went away:

<IfModule reqtimeout_module>
   RequestReadTimeout body=0
1 Like

heh. fixed my problem thanks firstly to you and also people on the github thread. Here’s what fixed it:

(basically commented out the loadmodule statement for mod_reqtimeout and restarted apache)

One thing that was confusing me though was that on an earlier installation, uploads were working. That one also has reqtimeout enabled and no extra config for it.

thanks again


I confirm this solution too.

To be more precise: The problem with mod_reqtimeout appeared with apache 2.4.39.

I had another identical hosting running 2.4.38 which did not show this problem at all. After updating that one to 2.4.39, it appeared there too.

Thanks to all for your postings!

1 Like

Thanks guys, this will be in the VM soon:

Since it is appears as 1st result on google search result page, I would like to add this, which might save other’s time.

Check out your Nginx, Apache, php log, if you find nothing, please try to disable http2.

Details for your referrence:

1 Like

Is this Solution actual and where do i have to add this?

In the /etc/apache2/apache2.conf? Or in aviable-sites nextcloud.conf?

This is pretty old and I don’t think this fix is needed anymore, but if you want to try it: the latter, sites-available/nextcloud.conf.

Hmm because i get this error in the actual version.

Sabre\DAV\Exception\BadRequest: Expected filesize of 47186681 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 44924928 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

Sorry for another question. I am not very familiar with Apache.
Do i have to write it in the normal nextcloud.conf and the ssl.conf?

Apache doesn’t need it in more than one place. Try the nextcloud.conf, restart apache, and see if it helps.

1 Like