Nextcloud ios app WebDAV locked file error

Hello community!
I am trying to upload the whole content from my iphone 11 to my nextcloud server. I am using nextcloud ios app with the option “Upload the whole camera roll”. The content is large (about 150gb) and for 1 day is uploaded only 1.5GB. I am receiving the following error:
“WebDAV Locked: Trying to access locked resource”
Also i see that is looping some files again and again with the error.
This is the log from my nextcloud server:

OCP\Lock\LockedException: “files/34a10310eb76105a324b83861ff02525” is locked

  1. /var/www/nextcloud/lib/private/Files/Storage/Common.php - line 779:OC\Lock\DBLockingProvider->changeLock(“files/34a10 … 5”, 2)
  2. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 615:OC\Files\Storage\Common->changeLock(“2017/08/17- … g”, 2, OC\Lock\DBLockingProvider {})
  3. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 615:OC\Files\Storage\Wrapper\Wrapper->changeLock(“2017/08/17- … g”, 2, OC\Lock\DBLockingProvider {})
  4. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 615:OC\Files\Storage\Wrapper\Wrapper->changeLock(“2017/08/17- … g”, 2, OC\Lock\DBLockingProvider {})
  5. /var/www/nextcloud/lib/private/Files/View.php - line 1968:OC\Files\Storage\Wrapper\Wrapper->changeLock(“2017/08/17- … g”, 2, OC\Lock\DBLockingProvider {})
  6. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php - line 392:OC\Files\View->changeLock("/iphone11/2 … g", 2)
  7. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 241:OCA\DAV\Connector\Sabre\Node->changeLock(2)
  8. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1130:OCA\DAV\Connector\Sabre\File->put("*** sensiti … *")
  9. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 513:Sabre\DAV\Server->updateFile("*** sensiti … *")
  10. <>Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R … "}, Sabre\HTTP\Response {})
  11. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:call_user_func_array([ Sabre\DAV\ … "], [ Sabre\HTTP … }])
  12. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:Sabre\Event\EventEmitter->emit(“method:PUT”, [ Sabre\HTTP … }])
  13. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R … "}, Sabre\HTTP\Response {})
  14. /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80:Sabre\DAV\Server->exec()
  15. /var/www/nextcloud/remote.php - line 163:require_once("/var/www/ne … p")

The version of the server is 16.0.1 on ubuntu 16.
Also i have nextcloud app on android and is working fine.

I upgraded the server to nextcloud 17.02.
Also installed redis

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,

No change, still having WebDav locked error

I found a workaround solution:

‘filelocking.enabled’ => false

Now the application is working fine without errors, but i receive the following warning in nextcloud server site:

There are some warnings regarding your setup.

* Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems. See the [documentation ↗](https://docs.nextcloud.com/server/17/go.php?to=admin-transactional-locking) for more information.

Anyone? I don’t beleive that i am the only one with this problem…

@ttsvetanov I have the exact same problem when syncing a huge ios library despite having no errors or recommendations when being in the instance overview

it was ok for thousands of photos but the ios client started showing those webdav errors when uploading videos

Redis is already helping a lot. The second thing is optimizing the database caches (mysqltuner, tuning-primer.sh). Before you try to synchronise your phone, try to put many small files via Nextcloud desktop client or directly via webdav (client software e.g. winSCP). Check your setting by how many files you can transfer per minute.

I have done this a long time ago, so don’t count to much on the settings and values but it gives you an idea:

thanks for your quick answer @tflidd

I will look into this.

But there is something I still don’t understand: despite having activated Redis, there are still thousands of things in the oc_file_locks db table, increasing over time. It’s increasing simply browsing files via the web interface. Isn’t redis supposed to be in charge of locking every files processed by the instance?

I would guess but I don’t know for sure. I’d first check if redis is really working not that there is a connection or permission problem and mysql is still used.