Skip to content

Sabre_DAV_Exception_BadRequest: expected filesize mismatch #9832

Closed

Description

@paulepanter

With ownCloud 7.0.0 (already present before in at least 6.0.4) I see a lot of Sabre_DEV_Exception_BadRequest errors in /var/www/owncloud/data/owncloud.log.

{"app":"webdav","message":"Sabre_DAV_Exception_BadRequest: expected filesize 4734206 got 458752","level":4,"time":"2014-07-10T13:58:54+00:00"}

There is one user having problems synchronizing it’s files with the server. The user has the latest ownCloud client 1.6.1 installed and experiences the problems with the client on Microsoft Windows and Mac OS. Other users with Mac OS and the client do not experience any problems.

Activity

  1. DeepDiver1975 commented on Jul 24, 2014

    @DeepDiver1975
    Contributor

    Starting with OC7 we log every webdav exception in order to enable easier debugging in case of sync issues. Not really relevant

    "expected filesize 4734206 got 458752" basically is telling us that a file upload was terminated before all data got passed to the server.

  2. DeepDiver1975 commented on Jul 24, 2014

    @DeepDiver1975
    Contributor

    In addition 'Sabre_DAV_Exception_BadRequest' is used in OC6 - but no longer in OC7.
    This error message is from OC6 times - log date confirms this (2014-07-10T13:58:54+00:00)

  3. paulepanter commented on Jul 24, 2014

    @paulepanter
    Author

    @DeepDiver1975, sorry for overlooking that information. For the said user, the ownCloud client currently shows that everything is synchronized and it shows 1.6 GB of data is stored on the server. But it should actually be over 20 GB.

  4. bastla commented on Jul 24, 2014

    @bastla

    I'm encountering the same problems with the update to OC 7.0.0 last night. Using davfs to mount my OC WebDav i can't create new files:

    {"app":"webdav","message":"Sabre\\DAV\\Exception\\BadRequest: expected filesize 163 got 0","level":4,"time":"2014-07-24T11:16:19+00:00"}
    

    Changing files and creating directories is working fine.

    Setup Server: Debian with owncloud 7.0.0
    Setup Client: Debian with davfs2 1.5.0-1

  5. DeepDiver1975 commented on Jul 24, 2014

    @DeepDiver1975
    Contributor

    @bastla the connection did break apart due to whatever reason. Not much we can do

  6. DeepDiver1975 commented on Jul 24, 2014

    @DeepDiver1975
    Contributor

    @paulepanter case closed?

  7. bastla commented on Jul 24, 2014

    @bastla

    @DeepDiver1975 Even tried it with a local mount. Still the same problem - connection doing great. :-S Do you have any idea?

  8. bastla commented on Jul 24, 2014

    @bastla

    @DeepDiver1975 Tested it with nautilus and konqueror - worked fine. Problem must be with davfs2. Sry for noise.

  9. paulepanter commented on Jul 25, 2014

    @paulepanter
    Author

    @DeepDiver1975, the other systems are in the same network and no problems are experienced otherwise. I think the issue should be left open until this has been properly debugged.

    Could it be that some time-outs are involved?

    Broken connections should not be a problem with HTTP, shouldn’t they?

  10. DeepDiver1975 commented on Jul 25, 2014

    @DeepDiver1975
    Contributor

    Best would be to find correlated log entries in server and client log to see what's going on.
    But as long as the sync client is running and files are properly synced your systems should be fine

  11. znoxx commented on Aug 20, 2014

    @znoxx

    This started for me after 6.x->7.0 upgrade
    cadaver works fine, actually
    May be some config tweaks for davfs ?

  12. IngLP commented on Aug 27, 2014

    @IngLP

    Same issue here. OC 7.0.1 running on linux. many errors like that even syncing in local (same pc server/client)
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 4931584 2014-08-27T22:36:06+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3956736 2014-08-27T22:33:56+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3883008 2014-08-27T22:23:28+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 5472256 2014-08-27T22:17:32+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3334144 2014-08-27T22:15:17+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 5496832 2014-08-27T22:09:21+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3809280 2014-08-27T22:07:11+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 6012928 2014-08-27T22:01:15+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3678208 2014-08-27T21:58:59+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3842048 2014-08-27T21:53:04+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 2460128 got 1507328 2014-08-27T21:53:04+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 4030464 2014-08-27T21:50:42+00:00
    Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 491520 2014-08-27T21:21:49+00:00

  13. Blisk commented on Aug 28, 2014

    @Blisk

    I have also that problem with OC 7.0.1 and client 1.6.2
    And no files are copied to server

    {"app":"webdav","message":"Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 5095424","level":4,"time":"2014-08-27T14:21:33+00:00"}
    {"app":"webdav","message":"Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 3448832","level":4,"time":"2014-08-27T14:39:41+00:00"}
    {"app":"webdav","message":"Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 7225344","level":4,"time":"2014-08-27T14:57:49+00:00"}

  14. OliverKohl commented on Aug 28, 2014

    @OliverKohl

    @paulepanter, @bastla: Is it possible that you have something like a WebWasher or a firewall in between, that either scans your content, blocks certain parts of your upload or forces the upload to terminate after a certain amount of GB or time.

    If not - is it possible that you have limited your upload size in PHP?

    @Blisk: For you I think the latter one applies due to the fact that your file sizes are dividable by 1024 (10485760 / 1024 / 1024 or 5095424 / 1024 / 1024) without remainder.

    If so please increase it.

    Cheers

    Oliver

  15. znoxx commented on Aug 28, 2014

    @znoxx

    @OliverKohlDSc
    I use localhost mount, even without https
    and php.ini value is
    upload_max_filesize = 16G
    I don't think it makes sense for 32 bit system, but anyway
    It fails even on 100mb files.
    But, again, cadaver client works fine

  16. 161 remaining items

  17. removed this from the milestone on Feb 23, 2016
  18. LaurentLM2I commented on Mar 8, 2016

    @LaurentLM2I

    Client: Version 2.1.1 (build 5837) sur machine Windows 10
    OR
    Client: Version 2.1.0 (build 5683) sur machine Windows 10
    Server: 8.2.2 (stable)
    Machine server: Debian Linux 8.3
    Apache2 Version 2.4.10
    PHP Version 5.6.17-0+deb8u1
    MySQL Version 5.5.47

    Error message when the client sync:

    26/02/2016 15:28:25, Création/Blois_MySQL.xlsx, ownCloud,Operation canceled
    26/02/2016 15:28:25, Création/Blois BSM 1.xlsx, ownCloud,Connexion fermée
    26/02/2016 15:28:23, Création/Maintenance 2016.pdf, ownCloud,Conserver sur liste noire : Error downloading https://SERVEUR/owncloud/remote.php/web ... aintenance 2016.pdf - server replied: Bad Request (expected filesize 29954 got 8192)
    
    

    Server logs:

    {"reqId":"qpoxfH+DfcfkfuImTQCk","remoteAddr":"IP","app":"webdav","message":"Exception: {"Message":"HTTP/1.1 400 expected filesize 5242880 got 8192","Exception":"Sabre\DAV\Exception\BadRequest","Code":0,"Trace":"
    #0 /var/www/owncloud/lib/private/connector/sabre/file.php(101): OC\Connector\Sabre\File->createFileChunked(Resource id #30)
    #1 /var/www/owncloud/lib/private/connector/sabre/directory.php(115): OC\Connector\Sabre\File->put(Resource id #30)
    #2 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(1053): OC\Connector\Sabre\Directory->createFile('Blois_MySQL.xls...', Resource id #30)
    #3 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(513): Sabre\DAV\Server->createFile('Création/...', Resource id #30, NULL)
    #4 [internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #5 /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
    #6 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(469): Sabre\Event\EventEmitter->emit('method:PUT', Array)
    #7 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #8 /var/www/owncloud/apps/files/appinfo/remote.php(56): Sabre\DAV\Server->exec()
    #9 /var/www/owncloud/remote.php(137): require_once('/var/www/ownclo...')
    #10 {main}","File":"/var/www/owncloud/lib/private/connector/sabre/file.php","Line":361}","level":4,"time":"2016-02-26T13:47:55+00:00"}
    {"reqId":"MsZWEoFnwpcxhYugBGXU","remoteAddr":"IP","app":"webdav","message":"Exception: {"Message":"HTTP/1.1 400 expected filesize 5242880 got 8192","Exception":"Sabre\DAV\Exception\BadRequest","Code":0,"Trace":"
    #0 /var/www/owncloud/lib/private/connector/sabre/file.php(101): OC\Connector\Sabre\File->createFileChunked(Resource id #30)
    #1 /var/www/owncloud/lib/private/connector/sabre/directory.php(115): OC\Connector\Sabre\File->put(Resource id #30)
    #2 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(1053): OC\Connector\Sabre\Directory->createFile('Blois BSM 1.xls...', Resource id #30)
    #3 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(513): Sabre\DAV\Server->createFile('Création/...', Resource id #30, NULL)
    #4 [internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #5 /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
    #6 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(469): Sabre\Event\EventEmitter->emit('method:PUT', Array)
    #7 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #8 /var/www/owncloud/apps/files/appinfo/remote.php(56): Sabre\DAV\Server->exec()
    #9 /var/www/owncloud/remote.php(137): require_once('/var/www/ownclo...')
    #10 {main}","File":"/var/www/owncloud/lib/private/connector/sabre/file.php","Line":361}","level":4,"time":"2016-02-26T13:47:56+00:00"}
    {"reqId":"XcYRnW0qBv3Lj6OUEf4g","remoteAddr":"IP","app":"webdav","message":"Exception: {"Message":"HTTP/1.1 400 expected filesize 29954 got 8192","Exception":"Sabre\DAV\Exception\BadRequest","Code":0,"Trace":"
    #0/var/www/owncloud/lib/private/connector/sabre/directory.php(115): OC\Connector\Sabre\File->put(Resource id #30)
    #1 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(1053): OC\Connector\Sabre\Directory->createFile('Maintenance...', Resource id #30)
    #2 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(513): Sabre\DAV\Server->createFile('Création/...', Resource id #30, NULL)
    #3 [internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #4 /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
    #5 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(469): Sabre\Event\EventEmitter->emit('method:PUT', Array)
    #6 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    #7 /var/www/owncloud/apps/files/appinfo/remote.php(56): Sabre\DAV\Server->exec()
    #8 /var/www/owncloud/remote.php(137): require_once('/var/www/ownclo...')
    #9 {main}","File":"/var/www/owncloud/lib/private/connector/sabre/file.php","Line":139}","level":4,"time":"2016-02-26T14:28:57+00:00"}
    
    

    I had to look this post: https://forum.owncloud.org/viewtopic.php?f=17&t=32517

    I just read it in detail and tested the following changes (without success):

    1. A bug in Apache https://github.com/owncloud/core/issues ... -148380791
    2. A too small "SSLRenegBufferSize" Apache setting https://github.com/owncloud/core/issues ... t-90508358
    3. A too small "LimitRequestBody" Apache setting https://github.com/owncloud/core/issues ... t-68443113
    4. Timeouts on server side https://github.com/owncloud/core/issues ... t-85709557
    5. Just a temporary network issue https://github.com/owncloud/core/issues ... t-86418646

    and:

    1. owncloud server> as administrator> I have set all of the users to quota = UNLIMITED
    2. The Following option added to my apache config: 10486000 SSLRenegBufferSize
      the apache config Was Located in /etc/apache2/conf.d/owncloud.conf, and is shown below:
    ---------------------------------- ------------- Conf.d ----------------------
    Alias ​​/ owncloud "/var/www/owncloud/"
    
    SSLRenegBufferSize 10486000
    Options + FollowSymLinks
    AllowOverride All
    
    <IfModule mod_dav.c>
      Dav off
    </ IfModule>
    
    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud
    
    # Just in case if .htaccess gets disabled
    Require all denied
    ----------------------------- ----------------- End conf.d -----------------
    
    1. etc / php5 / apache2 / php.ini has-been changed from 2M to 16G: upload_max_filesize = 16G

    2. /etc/apache2/httpd.conf point to server-tuning.conf Where I ensured
      KeepAlive On
      MaxKeepAliveRequests 500
      KeepAliveTimeout 500

    Restarted server: apache2 restart systemctl

    /etc/apache2/conf-available/owncloud.conf:

    Alias /owncloud "/var/www/owncloud/"
    <Directory /var/www/owncloud/>
    SSLRenegBufferSize 10486000
    Options +FollowSymLinks
    AllowOverride All
    SetEnv MOD_X_SENDFILE_ENABLED 1
    XSendFile On
    XSendFilePath /tmp/
    </Directory>
    
    

    /etc/apache2/sites-available/SERVEUR.conf:

    <VirtualHost *:443>
    DocumentRoot /var/www/owncloud
    ServerName SERVEUR
    <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    </IfModule>
    
    
    SSLEngine on
    SSLOptions +StdEnvVars
    SSLStrictSNIVHostCheck off
    
    SSLCertificateFile /etc/apache2/ssl/SERVEUR.crt
    SSLCertificateKeyFile /etc/apache2/ssl/SERVEUR.key
    
    </VirtualHost>
    
    

    /var/www/owncloud/config/config.php:

    <?php
    $CONFIG = array (
    'instanceid' => 'xxxxxxxxxxxxxxx',
    'passwordsalt' => 'xxxxxxxxxxxxxxx',
    'secret' => 'xxxxxxxxxxxxxxx',
    'trusted_domains' => 
    array (
    0 => 'SERVEUR',
    1 => 'IP',
    ),
    'datadirectory' => '/var/www/owncloud/data',
    'overwrite.cli.url' => 'https://SERVEUR/owncloud',
    'dbtype' => 'mysql',
    'version' => '8.2.2.2',
    'dbname' => 'owncloud',
    'dbhost' => 'localhost',
    'dbtableprefix' => '',
    'dbuser' => 'cloudAdmin',
    'dbpassword' => 'xxxxxxxxxxxxxxx',
    'logtimezone' => 'UTC',
    'installed' => true,
    'filelocking.enabled' => 'true',
    'memcache.locking' => '\\OC\\Memcache\\Redis',
    'redis' => 
    array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 500,
    'password' => '',
    'dbindex' => 0,
    ),
    'memcache.local' => '\\OC\\Memcache\\APCu',
    'theme' => '',
    'log_type' => 'owncloud',
    'logfile' => '/var/www/owncloud/data/owncloud.log',
    
    'loglevel' => 0,
    'log_rotate_size' => 10485760,
    
    'maintenance' => false,
    );
    

    ## impossible to synchronize new files. but if there are no new files, it works correctly ...

  19. LaurentLM2I commented on Mar 9, 2016

    @LaurentLM2I

    Hello,

    I just made a change in php.ini:

    sys_temp_dir = "/ home / owncloud / tmp"

    and now I no longer have the problem.

  20. awnz commented on Mar 29, 2016

    @awnz

    Because of client bug 4334, my workaround (above) no longer works under Linux :(

  21. guruz commented on Apr 25, 2016

    @guruz
    Contributor

    @awnz You should be able to start the client with OWNCLOUD_MAX_PARALLEL=1 owncloud

  22. awnz commented on Apr 25, 2016

    @awnz

    Thanks @guruz, I've replied in (4334)[https://github.com/owncloud/client/issues/4334#issuecomment-214220805]

  23. PVince81 commented on May 18, 2016

    @PVince81
    Contributor

    Please try with this potential solution: #24653 (comment)
    So far it solves the problem when the received filesize is "0" but with a bit of luck it might work in some of your situations too.

  24. MorrisJobke commented on May 18, 2016

    @MorrisJobke
    Contributor

    We should close this as fixed within the scope of #24653 - if this still happens with all the next maintenance releases then we need to investigate further.

  25. lock commented on Aug 4, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  26. locked as resolved and limited conversation to collaborators on Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions