Cannot upload any files from both Windows an Android

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): 20.0.0
Operating system and version (eg, Ubuntu 20.04): Debian 10 running official :latest Docker image
Apache or nginx version (eg, Apache 2.4.25): I believe Apache (:latest Docker Image Tag)
PHP version (eg, 7.1): Don’t Know (:latest Docker Image Tag)

The issue you are facing:
When I have files being upload via auto-upload on the android app and some files syncing on a 20.04 Windows 10 machine. I see a lot of “Sabre\DAV\Exception\BadRequest” in the error logs. And in the Android app at least I only see unknown error and the file gets queued up to try again later but will never end up getting uploaded to the system. On the windows I get errors and sometimes the files get truncated and the proper size isn’t uploading. The files themselves fully upload and get to 100% then will throw an error after I’m guessing the server does some processing on it’s end.

I will note that this isn’t a hard drive size issue the nextcloud data folder is on a 32TB array with more than 10TB available to use.

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

Steps to replicate it:

  1. In either the Android app or Windows Client start a sync either triggered manually or when a new file is added to a specific directory
  2. Let the upload get to 100%
  3. The upload should now fail or succeed but the file isn’t the correct size or have less data in it than it should

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: Sabre\DAV\Exception\BadRequest: Expected filesize of 10240000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 9314304 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side. at <<closure>>

 0. /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php line 155
    OCA\DAV\Connector\Sabre\File->put(null)
 1. /var/www/html/apps/dav/lib/Upload/UploadFolder.php line 46
    OCA\DAV\Connector\Sabre\Directory->createFile("0000000000000000-0000000010239999", null)
 2. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 1104
    OCA\DAV\Upload\UploadFolder->createFile("0000000000000000-0000000010239999", null)
 3. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 527
    Sabre\DAV\Server->createFile("uploads/doni/cb ... 9", null, null)
 4. /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
 5. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 474
    Sabre\DAV\Server->emit("method:PUT", [Sabre\HTTP\Requ ... }])
 6. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 251
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
 7. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    Sabre\DAV\Server->start()
 8. /var/www/html/apps/dav/lib/Server.php line 325
    Sabre\DAV\Server->exec()
 9. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
10. /var/www/html/remote.php line 167
    require_once("/var/www/html/a ... p")

PUT /remote.php/dav/uploads/jeansburger/cb288dd0f602a527d5e379bee9eb6723/0000000000000000-0000000010239999
from 192.168.1.106 by doni at 2020-10-16T21:15:43+00:00
[PHP] Error: Error: Cannot modify header information - headers already sent by (output started at /var/www/html/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/html/apps/dav/lib/Connector/Sabre/File.php#691 at <<closure>>

0. <<closure>>
   OC\Log\ErrorHandler::onError(2, "Cannot modify h ... )", "/var/www/html/a ... p", 691, {string: "X-Hash ... "})
1. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 691
   header("X-Hash-SHA256:  ... d")
2. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 195
   OCA\DAV\Connector\Sabre\File->header("X-Hash-SHA256:  ... d")
3. <<closure>>
   OCA\DAV\Connector\Sabre\File->OCA\DAV\Connector\Sabre\{closure}("*** sensitive parameters replaced ***")
4. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 71
   call_user_func(Closure {}, "*** sensitive parameter replaced ***")
5. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 319
   OC\Files\Stream\HashWrapper->stream_close()
6. /var/www/html/apps/dav/lib/Server.php line 325
   Sabre\DAV\Server->exec()
7. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
   OCA\DAV\Server->exec()
8. /var/www/html/remote.php line 167
   require_once("/var/www/html/a ... p")

PUT /remote.php/dav/uploads/jeansburger/cb288dd0f602a527d5e379bee9eb6723/0000000000000000-0000000010239999
from 192.168.1.106 by doni at 2020-10-16T21:15:43+00:00
[PHP] Error: Error: Cannot modify header information - headers already sent by (output started at /var/www/html/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/html/apps/dav/lib/Connector/Sabre/File.php#691 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(2, "Cannot modify h ... )", "/var/www/html/a ... p", 691, {string: "X-Hash ... "})
 1. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 691
    header("X-Hash-SHA1: 5c ... b")
 2. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 192
    OCA\DAV\Connector\Sabre\File->header("X-Hash-SHA1: 5c ... b")
 3. <<closure>>
    OCA\DAV\Connector\Sabre\File->OCA\DAV\Connector\Sabre\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 71
    call_user_func(Closure {}, "*** sensitive parameter replaced ***")
 5. <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
 6. /var/www/html/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php line 132
    fclose(null)
 7. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 75
    Icewind\Streams\Wrapper->stream_close()
 8. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    OC\Files\Stream\HashWrapper->stream_close()
 9. /var/www/html/apps/dav/lib/Server.php line 325
    Sabre\DAV\Server->exec()
10. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
11. /var/www/html/remote.php line 167
    require_once("/var/www/html/a ... p")

PUT /remote.php/dav/uploads/jeansburger/cb288dd0f602a527d5e379bee9eb6723/0000000000000000-0000000010239999
from 192.168.1.106 by doni at 2020-10-16T21:15:43+00:00
[PHP] Error: Error: Cannot modify header information - headers already sent by (output started at /var/www/html/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/html/apps/dav/lib/Connector/Sabre/File.php#691 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(2, "Cannot modify h ... )", "/var/www/html/a ... p", 691, {string: "X-Hash ... "})
 1. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 691
    header("X-Hash-MD5: 3b6 ... d")
 2. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 189
    OCA\DAV\Connector\Sabre\File->header("X-Hash-MD5: 3b6 ... d")
 3. <<closure>>
    OCA\DAV\Connector\Sabre\File->OCA\DAV\Connector\Sabre\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 71
    call_user_func(Closure {}, "*** sensitive parameter replaced ***")
 5. <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
 6. /var/www/html/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php line 132
    fclose(null)
 7. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 75
    Icewind\Streams\Wrapper->stream_close()
 8. <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
 9. /var/www/html/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php line 132
    fclose(null)
10. /var/www/html/lib/private/Files/Stream/HashWrapper.php line 75
    Icewind\Streams\Wrapper->stream_close()
11. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    OC\Files\Stream\HashWrapper->stream_close()
12. /var/www/html/apps/dav/lib/Server.php line 325
    Sabre\DAV\Server->exec()
13. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
14. /var/www/html/remote.php line 167
    require_once("/var/www/html/a ... p")

PUT /remote.php/dav/uploads/jeansburger/cb288dd0f602a527d5e379bee9eb6723/0000000000000000-0000000010239999
from 192.168.1.106 by doni at 2020-10-16T21:15:43+00:00

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\\Redis',
  'redis' => 
  array (
    'host' =>  **REDACTED**,
    'port' => 6379,
  ),
  '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' => '**REDACTED**',
  'passwordsalt' => '**REDACTED**',
  'secret' => '**REDACTED**',
  'trusted_domains' => 
  array (
    0 => '**REDACTED**',
    1 => '**REDACTED**',
  ),
  'trusted_proxies' => 
  array (
    0 => '**REDACTED**',
  ),
  'datadirectory' => '/var/www/html/data',
  'overwrite.cli.url' => '**REDACTED**',
  'overwriteprotocol' => 'https',
  'overwritecondaddr' => '^**REDACTED**$',
  'dbtype' => 'mysql',
  'version' => '20.0.0.9',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '**REDACTED**',
  'installed' => true,
  'loglevel' => 0,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '**REDACTED**',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '**REDACTED**',
  'mail_smtppassword' => '**REDACTED**',
  'mail_smtphost' => '**REDACTED**',
  'mail_smtpport' => '587',
  'theme' => '',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'mysql.utf8mb4' => true,
  'has_rebuilt_cache' => true,
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'files_retention',
    1 => 'carnet',
    2 => 'files_markdown',
    3 => 'ocr',
  ),
);