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

Ok -


$CONFIG = array (
‘apps_paths’ =>
array (
0 =>
array (
‘path’ => ‘/usr/local/www/nextcloud/apps’,
‘url’ => ‘/apps’,
‘writable’ => true,
1 =>
array (
‘path’ => ‘/usr/local/www/nextcloud/apps-pkg’,
‘url’ => ‘/apps-pkg’,
‘writable’ => false,
‘logfile’ => ‘/var/log/nextcloud/nextcloud.log’,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘instanceid’ => ‘ocixq9iqzsm5’,
‘passwordsalt’ => ‘REDACTED’,
‘secret’ => ‘REDACTED’,
‘trusted_domains’ =>
array (
0 => ‘’,
‘datadirectory’ => ‘/usr/local/www/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘’,
‘overwrite.cli.url’ => ‘’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘oc_REDACTED’,
‘dbpassword’ => ‘REDACTED’,
‘installed’ => true,
‘mysql.utf8mb4’ => true,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 2,
‘mail_from_address’ => ‘www-cloud’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_domain’ => ‘REDACTED’,
‘mail_smtphost’ => ‘localhost’,
‘mail_smtpport’ => ‘25’,
‘’ => ‘production’,

php_value upload_max_filesize 16G
php_value post_max_size 16G
php_value memory_limit 512M
php_value mbstring.func_overload 0
php_value default_charset ‘UTF-8’
php_value output_buffering 0


Does owncloud suffer from the same problem? Or is it a sabre problem?

After doing some googling, it seems this same problem (though reported differently) happens in some installations but not others, regardless of how it’s hosted and on whatever OS, and regardless of version of NC, and there is no clear fix despite the issue being posted in one form or another for years. Worryingly, some folks have posted that their installation worked fine and then the problem started happening (and no clear indication of a resolution).

This particular installation is a brand new installation, installed at the end of March. I only discovered the problem after trying to upload a file over 2.4MB the first time. Interestingly, it does not have a problem installing various addons, or updating (the latter would be well over 2.4MB). On another virtual machine that is hosted on the same host, using the same OS, this problem does not happen.

Is there no fix for this? is the only resolution to delete the VM and start over? And hope that it doesn’t somehow just start happening again?

just tried with a fresh install, newly compiled apache24, php72 mysql certbot etc and same result. I’ll try spinning up an ubuntu vm next

edit; maybe it’s because a ssl cert was installed beforehand?

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

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