Sabre\DAV\Exception\BadRequest: expected filesize

Hi together!

currently I am using the latest Nextcloud Pi (NextCloudPi_RPi_07-20-19) Project on the RaspberryPi 3 B +. I had this Project already running for a long time, but then it crashed due an update and I was forced to recover the entire system. I thought it’s gonna be an easy task, but I’m facing since then always the same error. I updated the whole system before I initiated a sync.

I am struggling with the set-up. I have the 2-Factor-Authentication configured and I run the Nextcloud client in an Linux Mint. Once the sync started, the Client shows the following error after a while:


The Server log on the PI Project shows:

Fatal webdav Sabre\DAV\Exception\BadRequest: expected filesize 305320 got 270336

/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:

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

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

OCA\DAV\Connector\Sabre\Directory->createFile("ML5PQHBWWPG ... =", null)

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

Sabre\DAV\Server->createFile("files/olaf. ... =", null, null)

<<closure>>

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

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

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

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

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

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

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

/var/www/nextcloud/apps/dav/lib/Server.php - line 316:

Sabre\DAV\Server->exec()

/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/nextcloud/remote.php - line 163:

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

I tried to find a soloution, I applied changes to /etc/php/7.3/fpm/php.ini
and increased the upload_max_filesize from 2M to 2000M and the timeout for uploads from 60s to 3600s. I only could find an empty user.ini
I constanly face the idenical error!

I appreciate any help!!
Thenk you,

1 Like

I have the same issue with my Raspberry Pi 4 with 4GB Ram. I installed the nextcloudpi.img for my Pi and use it with 2x8TB. One is for Backup. Everything works, for example creating folders or textfiles.

But if I try to upload an image it becomes an Error Message: An unknown error has occurred.

My Logs looks like this:


On the second picture, I dont understand why it use the media/USBdrive for Temporary Files. I set it in the Nextcloud config var/www/nextcloud/config/config.php to my mounted drive.

Check if your Drives are right mounted with lsblk.

I hope someone find a solution with this information.

Same Error for me with no solution until yet. Raspi 4 with 4 GB in use.

→ Reset the temp-dir does not help

modify modreqtimeout_module does not help also.

So i think it is an general problem but no developer seems to have a solution?!

I have the same Problem. Any ideas yet?

Changed the Temp-Dir as suggested etc. but nothing helps. This seems to be the ciritical error:

Error PHP fread(): Unable to create temporary file, Check permissions in temporary files directory. at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#91

#push#…Any Idea?

same issue here! been searching for days on this. I use apache2, php-fpm, Latest NC (18.0.4), I’ve disabled HTTP2, disabled reqtimeout module, tried a few others and nothing. same problem. PLEASE HELP

Same problem here… does anyone have a solution?

Hello, I’m struggling with 100-130 B/s (not mega, kilo, but bytes per second) upload speed from Firefox (or any browser) to Nextcloud and tried also this tmp path correction, without succes. (Nextcloud 18 transfer speed slow - #12 by tflidd)

10G filesize limit is set, and it works fine with Linux, copying to Nextcloud directory which is visible in Nautilus (default Ubuntu file browser) 70-100 Mbit/s and also from Android Nextcloud client.

My configs now related to tmp

/etc/php/7.4/fpm/php.ini
sys_temp_dir = “/usr/share/nginx/nextcloud/data/tmp”
/usr/share/nginx/nextcloud/config/config.php
‘tempdirectory’ => ‘/usr/share/nginx/nextcloud/data/tmp’,
and directory rights
drwxr-xr-x 2 www-data www-data 4096 Mar 12 21:01 tmp

I have enabled debugging/info logging, but it doesn’t give any hint related to this issue.