Auto uploads failed on Android. Sabre\DAV\Exception\BadRequest: Expected filesize of 4625 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 4096 bytes

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): docker latest(18.0.4)
Operating system and version (eg, Ubuntu 20.04):Armbian Buster with Linux 5.4.2-rockchip64
Apache or nginx version (eg, Apache 2.4.25): docker latest
PHP version (eg, 7.1):docker latest

The issue you are facing:

Auto uploads failed on Android. ( nextcloud-dev-20200521.apk) but manual uploads worked.

IOS auto uploads worked fine.

I tried this "HEADERS on invalid stream", but not worked for me.

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

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

Fatal	webdav	Sabre\DAV\Exception\BadRequest: Expected filesize of 4625 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 4096 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 156:

OCA\DAV\Connector\Sabre\File->put(null)

/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:

OCA\DAV\Connector\Sabre\Directory->createFile("mengtuiUnSelected.png", null)

/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525:

Sabre\DAV\Server->createFile("实时上传/qk/ico ... g", null, null)

<<closure>>

Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])

/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])

/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/html/apps/dav/appinfo/v1/webdav.php - line 82:

Sabre\DAV\Server->exec()

/var/www/html/remote.php - line 165:

require_once("/var/www/ht ... p")

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => '192.168.123.3:8888',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'http://192.168.123.3:8888',
  'dbname' => 'nextcloud',
  'dbhost' => '172.18.0.3',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => '***',
  'installed' => true,
  'tempdirectory' => '/var/www/html/data/tmp',
);

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

PASTE HERE

I tried this Not able to upload files bigger than 8192 Bytes, commented out mod_reqtimeout in apache2, the problem remains the same.

Pls help me, thanks a lot.

I updated a new app version (nextcloud-dev-20200526.apk), and it worked fine.