Broken uploads - DAV Exception BadRequest Message expected filesize 7900672 got 7143424


#1

Upload of large files doesn’t work. Neither through webgui nor Nextcloud Desktop client.

Nextcloud version 13.0.0:
Operating system and version 16.04:
Apache or nginx version nginx/1.10.3:
PHP version 7.1:

In nextcloud.log I see the following entry.

{"reqId":"Q7RLpXqphGC414n02Wdp","level":4,"time":"2018-04-14T13:00:21+00:00","remoteAddr":"92.192.43.227","user":"admin","app":"webdav","method
":"PUT","url":"\/remote.php\/dav\/files\/...........................................................................................ppt","mess
age":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\BadRequest\",\"Message\":\"expected filesize 7900672 got 7143424\",\"Code\":0,\"
Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(151): OCA\\\\DAV\\\\Connector\\\\Sabre\\\
\File->put(Resource id #21)\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1096): OCA\\\\DAV\\\\Conne
ctor\\\\Sabre\\\\Directory->createFile('I.................', Resource id #21)\\n#2 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/l
ib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('files\\\/admin\\\/Pro...', Resource id #21, NULL)\\n#3 [internal function
]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/nextcloud\\\
/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#5 \\\/var\\\/www\\\/nextcloud\\\/3rdpar
ty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#6 \\\/var\\\/www\\\/nextcloud
\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sa
bre\\\\HTTP\\\\Response))\\n#7 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Server.php(283): Sabre\\\\DAV\\\\Server->exec()\\n#8 \\\/va
r\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(35): OCA\\\\DAV\\\\Server->exec()\\n#9 \\\/var\\\/www\\\/nextcloud\\\/remot
e.php(164): require_once('\\\/var\\\/www\\\/nextcl...')\\n#10 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connecto
r\\\/Sabre\\\/File.php\",\"Line\":178}","userAgent":"Mozilla\/5.0 (Windows) mirall\/2.3.3 (build 1) (Nextcloud)","version":"13.0.0.14"}```

Sabre\DAV\Exception\BadRequest: expected filesize 2584835 got 1114112
Nextcloud 13 chunking upload not working
Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 2490368
#2

Same Issue, tried editing nextcloud.conf and php.ini for max-upload filesize, without success.

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

  1. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #23)
  2. /var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php - line 39: OCA\DAV\Connector\Sabre\Directory->createFile(‘0’, Resource id #23)
  3. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096: OCA\DAV\Upload\UploadFolder->createFile(‘0’, Resource id #23)
  4. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile(‘uploads/steffen…’, Resource id #23, NULL)
  5. [internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  6. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
  7. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method PUT’, Array)
  8. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  9. /var/www/nextcloud/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
  10. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
  11. /var/www/nextcloud/remote.php - line 164: require_once(’/var/www/nextcl…’)
  12. {main}

I am running Nextcloud 13.0.0 on Ubuntu 16.04.4 LTS with PHP Version 7.0.28.


#3

No idea any one?


#4

Update: I did set up a virtual server with Ubuntu 16:04 and nextcloud 12.0.7 to see if the error also occures in erlier versions. The uploads went flawlessly however when i migrated 12.0.7 on my existing server the error occures again and i have no clue why?! I freshly installed nextcloud and removed all existing log + db files. Anyone has an idea why this error happens on an “open”-Server with the same setup as my local bridged server ?!


#5

Well. In the meantime.

First:
I updated the “broken” installation to
Nextcloud version 13.0.2 :
Operating system and version 16.04 :
Apache or nginx version nginx/1.14.0 :
PHP version 7.2.4
Still uploads don’t work.

Second:
I installed on a different server everything from scratch with https://github.com/ReinerNippes/nextcloud13
Made a backup (from broken) and restore (to fresh). Upload works on the fresh machine.

Is there an easy way to compare the ini setings of nginx and/or php? The phpinfo page is nice to read for humans but difficult to compare wit diff. I think.


#7

partial solution here