Error Uploading - BadRequest

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, 20.0.5): 23.0.2.1
Operating system and version (eg, Ubuntu 20.04): Debian 4.19.0-18
Apache or nginx version (eg, Apache 2.4.25): nginx/1.14.2
PHP version (eg, 7.4): 7.3

The issue you are facing:

Everytime I try to upload some files to NextCloud, I get this error back:

{“reqId”:“A8JLMVs6fw2xHoKkDiUT”,“level”:3,“time”:“2022-02-27T13:37:15+00:00”,“remoteAddr”:“177.154.7.112”,“user”:“skapskap”,“app”:“no app in context”,“method”:“PUT”,“url”:"/nextcloud/remote.php/dav/uploads/skapskap/web-file-upload-4e39a33219cd9e477322c069198f1136-1645968935389/0",“message”:“Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10215424 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 OPR/83.0.4254.66”,“version”:“23.0.2.1”,“exception”:{“Exception”:“Sabre\DAV\Exception\BadRequest”,“Message”:“Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10215424 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.”,“Code”:0,“Trace”:[{“file”:"/srv/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",“line”:155,“function”:“put”,“class”:“OCA\DAV\Connector\Sabre\File”,“type”:"->",“args”:[null]},{“file”:"/srv/nextcloud/apps/dav/lib/Upload/UploadFolder.php",“line”:45,“function”:“createFile”,“class”:“OCA\DAV\Connector\Sabre\Directory”,“type”:"->",“args”:[“0”,null]},{“file”:"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:1098,“function”:“createFile”,“class”:“OCA\DAV\Upload\UploadFolder”,“type”:"->",“args”:[“0”,null]},{“file”:"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",“line”:504,“function”:“createFile”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[“uploads/skapskap/web-file-upload-4e39a33219cd9e477322c069198f1136-1645968935389/0”,null,null]},{“file”:"/srv/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“httpPut”,“class”:“Sabre\DAV\CorePlugin”,“type”:"->",“args”:[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:472,“function”:“emit”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[“method:PUT”,[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]]},{“file”:"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:253,“function”:“invokeMethod”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:321,“function”:“start”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:},{“file”:"/srv/nextcloud/apps/dav/lib/Server.php",“line”:339,“function”:“exec”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:},{“file”:"/srv/nextcloud/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\DAV\Server”,“type”:"->",“args”:},{“file”:"/srv/nextcloud/remote.php",“line”:166,“args”:["/srv/nextcloud/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/srv/nextcloud/apps/dav/lib/Connector/Sabre/File.php",“Line”:245,“CustomMessage”:"–"}}

I have nextcloud installed in swizzin on nginx.
I searched everywhere and didnt find a solution. I already changed my tmp folder in php.ini and reloaded, but it didn’t work. Every time I get the error nextcloud stop working for a few minutes or until I reload/restart nginx.
Extra: For some reason, whenever I try to access nextcloud with AirExplorer via WebDAV with my SSL URL, I can’t get the connection. When I try to access it with another URL proxied by cloudflare, I get to access.
I’m trying to upload with CyberDuck as I didn’t get AirExplorer to work.

PS: I had another dedicated server with nextcloud installed and never got this error before.

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

Steps to replicate it:

  1. ???
  2. ???
  3. ???

The output of your Nextcloud log in Admin > Logging:

Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10215424 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:37:15-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10117120 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:37:15-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10158080 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:37:15-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10248192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:37:15-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 419094587 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14974976 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:19:56-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 419595491 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14974976 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:19:50-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 419360858 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14934016 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:16:08-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 419127427 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14950400 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:16:08-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 444466673 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14934016 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:12:46-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 318556921 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14950400 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:12:46-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 476863110 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14950400 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:08:22-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 476860913 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 14950400 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T10:08:22-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 245992542 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 15015936 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T09:57:10-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 229074807 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 15032320 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T09:57:10-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 217797495 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 15015936 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T09:57:10-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 245281237 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 63447040 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T09:57:08-0300
Erro	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 277340741 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 65798144 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-02-27T09:57:08-0300

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

/srv/nextcloud/config/config.php

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

/var/log/nginx