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