Sabre\DAV\Exception\BadRequest Nextcloud

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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 is running on an Proxmox Virtual Machine which is connected with a Cloudflare Tunnel.

Nextcloud version (eg, 20.0.5):
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52
PHP version (eg, 7.4): 8.1.2

Steps to replicate it:

  1. Open the Nextcloud app on the IPhone
  2. Go to Settings, Auto upload
  3. Select “Only use Wi-Fi connection” for video and photos, “Upload the whole camera roll” and “use subfolders”
  4. Click “Change filename mask” and select “Specify type in filename”

The output of your Nextcloud log in Admin > Logging:

Sabre\DAV\Exception\BadRequest: Expected filesize of 2753689 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1391747 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

    /var/www/ - line 149:
    /var/www/ - line 1098:
    OCA\DAV\Connector\Sabre\Directory->createFile("*** sensiti ... *")
    /var/www/ - line 504:
    Sabre\DAV\Server->createFile("*** sensiti ... *")
    /var/www/ - line 89:
    /var/www/ - line 472:
    /var/www/ - line 253:
    /var/www/ - line 321:
    /var/www/ - line 366:
    /var/www/ - line 35:
    /var/www/ - line 171:
    require_once("/var/www/ne ... p")

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

$CONFIG = array (
  'instanceid' => '###',
  'passwordsalt' => '###',
  'secret' => 'P1LLMtKBMuOqOlHsqTAOm11kKfYVM0dx5DqjyiBQWo3fGdZg',
  'trusted_domains' =>
  array (
    0 => '',
  'datadirectory' => '/home/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '###',
  'dbpassword' => '###',
  'installed' => true,
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',

This can probably be ignored, the exception should be caught and not logged.