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.