Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 2490368

Nextcloud version (eg, 12.0.2): 13.1
Operating system and version (eg, Ubuntu 17.04): Centos 7.3
Apache or nginx version (eg, Apache 2.4.25): apache 2.4
PHP version (eg, 7.1): php 5.6

The issue you are facing: these two errors and can not upload large files

Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 2490368
Sabre\DAV\Exception\ServiceUnavailable: Could not open file

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

Uploading large files

The output of your Nextcloud log in Admin > Logging:

	Sabre\DAV\Exception\ServiceUnavailable: Could not open file

    /var/www/html/nextcloud/apps/dav/lib/Upload/AssemblyStream.php - line 246: OCA\DAV\Connector\Sabre\File->get()
    /var/www/html/nextcloud/apps/dav/lib/Upload/AssemblyStream.php - line 118: OCA\DAV\Upload\AssemblyStream->getStream(Object(OCA\DAV\Connector\Sabre\File))
    [internal function] OCA\DAV\Upload\AssemblyStream->stream_read(8192)
    /var/www/html/nextcloud/lib/private/legacy/helper.php - line 297: fread(Resource id #33, 8192)
    /var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 163: OC_Helper streamCopy(Resource id #33, Resource id #34)
    /var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #33)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 314: OCA\DAV\Connector\Sabre\Directory->createFile('Jupiter.Ascendi...', Resource id #33)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 130: Sabre\DAV\Tree->copyNode(Object(OCA\DAV\Upload\FutureFile), Object(OCA\DAV\Connector\Sabre\Directory), 'Jupiter.Ascendi...')
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 161: Sabre\DAV\Tree->copy('uploads/herc/16...', 'files/herc/Film...')
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642: Sabre\DAV\Tree->move('uploads/herc/16...', 'files/herc/Film...')
    [internal function] Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method MOVE', Array)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/nextcloud/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
    /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
    /var/www/html/nextcloud/remote.php - line 164: require_once('/var/www/html/n...')
    {main}
_____________________________________________________________________

Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 2490368

    /var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #21)
    /var/www/html/nextcloud/apps/dav/lib/Upload/UploadFolder.php - line 39: OCA\DAV\Connector\Sabre\Directory->createFile('00000023', Resource id #21)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096: OCA\DAV\Upload\UploadFolder->createFile('00000023', Resource id #21)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('uploads/herc/29...', Resource id #21, NULL)
    [internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/html/nextcloud/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
    /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
    /var/www/html/nextcloud/remote.php - line 164: require_once('/var/www/html/n...')
    {main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (

  'trusted_domains' => 
  array (
    0 => 'nextcloud.mydomain.net',
  ),
  'datadirectory' => '/var/www/nextcloud/data/nextcloud',
  'tempdirectory' => '/var/www/nextcloud/tmp',
  'overwrite.cli.url' => 'http://nextcloud.mydomain.net',
  'dbtype' => 'mysql',
  'version' => '13.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloudpass',
  'installed' => true,
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
 'redis' => array(
      'host' => 'localhost',
      'port' => 6379,
       ),

  'mail_from_address' => 'dennis',
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'mydomain.net',
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

29750881_10212842697557171_668405621_n

I have on the same server installed owncloud too and there works uploading large files with no problem.
But not on nextcloud so server settings are ok, must be something with nextcloud.

I have manage to solve problem with uploading large files, but I still hope someone will help with these errors.
Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 2490368

I have the same issues Hopefully someone can help out with this?

same here…

Hi,

Have you searched the forum for solutions? This came up quite often already.
You could check this older article from Owncloud and see if one or more of the possible reason applies to your environment:

https://central.owncloud.org/t/expected-filesize-xxx-got-yyy-0/816

Additionally you could check this here:


Please let other users in this thread know if one of these points helped and which one exactly.

i actually followed every step on this list without success… it seems like this is a common bug without a real fix yet … really need some help with this - unfortunetly none of the existing solution approaches got this fixed yet.

Hi,

I suggest you open a new thread, use and fill out the issue template and provide as much information as possible for your issue.
Please also explain since when this issue occurred, what you changed since.
Furthermore please check every log file related (web server, system, nextcloud) for any relevant information and post these log entries as well.
As caching or timeout issues may be the reason, you could probably provide some information as well.

I would also run wireshark and have a look at the network trace.

@Schmu: Done.

I have the same error occuring. It ONLY happens with the iOS client, with an iPhone 8 and an iPad Air 2. No problems with the Android client nor with Firefox or the Windows client.
System: Raspi 3B+, Nextcloud 13.0.6

Also: triggering of autoupload on the iOS clients is not really working. With Android it works like a charme

think im getting the same issue

Sabre\DAV\Exception\ServiceUnavailable: Could not open file

oddly enough works on phone (android) but not desktop (linux or windows)