Error while copying file to target location (copied bytes: 0, expected filesize: )


The desktop sync client fails to upload a file (3.8GiB) with this error on the admin side:

Sabre\DAV\Exception: Error while copying file to target location (copied bytes: 0, expected filesize: )

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


/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 316:

OCA\DAV\Connector\Sabre\Directory->createFile("MVI_9368.MOV", null)

/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 130:

Sabre\DAV\Tree->copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Conn ... {}, "MVI_9368.MOV")

/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 161:

Sabre\DAV\Tree->copy("uploads/manon/173466758/.file", "files/manon ... V")

/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642:

Sabre\DAV\Tree->move("uploads/manon/173466758/.file", "files/manon ... V")


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

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

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

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

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

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

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

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


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


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

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

I noticed that a .part file of 2GiB is being created on the folder (server side) after the error. I suspect the network part is OK since it takes the expected time to perform the actual upload.

I run nextcloud 16.0.5 on a pi (arm 32 bits), precisely I use the fpm dockerized version.
Everything else seems to be working OK. fpm is configured to run children jobs dynamically (up to 12 children).
I didn’t notice any resource limitation during the upload (the system doesn’t swap, everything is responsive)

I have no idea where to look next.

It was large file support in PHP for docker images that was missing, this PR fixes the issue

What can I do to solve the problem in my system?

Thanks in advance.

You can enable large file support in the PHP that runs nextcloud.