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

#8

Sabre is dead meat now…
It was fucking idiotic decision to make to tighten so tighly with something this dead…
that does not change the fact that NC’s devs have an obligation to rremove every usage of Sabre-* package(s) from NC as soon as people started to become vocal…

Not to mention Im being spammed by meaningless logentries all the time.

#9

Ok - config.inc.php

<?php

$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 => ‘cloud.REDACTED.net’,
),
‘datadirectory’ => ‘/usr/local/www/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘15.0.7.0’,
‘overwrite.cli.url’ => ‘http://cloud.REDACTED.net/nextcloud’,
‘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’,
‘updater.release.channel’ => ‘production’,
);

#10

[.htaccess]
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

#11

[.user.ini]
upload_max_filesize=16G
post_max_size=16G
memory_limit=512M
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset=‘UTF-8’
output_buffering=0

#12

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?

#13

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?

#14

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.

#15

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.

#16

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.

#17

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

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

#18

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

#19

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

#20

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.

#21

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 https://download.nextcloud.com/server/releases/nextcloud-15.0.7.tar.bz2

#22

and it still fails :frowning:

#23

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

#24

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

https://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html


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

<IfModule reqtimeout_module>
   RequestReadTimeout body=0
 </IfModule>
#25

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

4 Likes
Unable to rename folder or upload data on Windows 10 mount via WebDav
#26

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
#27

Thanks guys, this will be in the VM soon: https://github.com/nextcloud/vm/pull/843