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.

**(#$@*@ing free software :((((

now I’m experiencing this issue after tons of others in nextcloud. What the hell I’m already living in the configurations.

Same Webdav errors comes out when I try to upload files from my IOS device to nextcloud. Redis is activated. What else should I do?

Well, without more details it is hard to say what might be wrong. Is it just the ios app? In such a case, open your own topic and give more details.

1 Like

@tflidd Same issue here and I have exhausted all related 423 error pages for potential solutions, and none of them worked (Redis, timeout in php configs, etc, etc).
I believe this topic here is exactly about that issue: WebDAV 423 error with the iOS app.

I believe someone reported the issue a year ago, whiteout any traction either: here
What additional details could we share to help debugging? Happy to do anything useful, even debugging.

My context / config on iOS client app:

  • nextcloud running in docker on Ubuntu server.
  • Latest iOS app connected to the server. I activate photo upload and the options are:
  • FULL history (so not the default that uploads only new photos going forward)
  • Upload of videos too
  • Both photos and videos are uploaded on Wifi only.

the iOS app prepares that setup for a couple of minutes, then starts to upload. There is a double arrow icon appearing in the top right corner of the app, tapping on it shows pending uploads.

I can see uploads going through, several files in parallel all the time. Then after a few minutes of the upload process going through, it starts failing some uploads with the infamous 423 error. Files fall into 423, but not all of them. At some point there will be 100 files that fell into 423 error, therefore that upload screen doesn’t show anything else anymore than the 100 first failed uploads. There is a Stop icon on the right of each file name but it does nothing by tapping it. There is not retry icon either (could be a potential fix to get either an automatic retry at some point / a manual one that could be triggered)

I have tried to upload my photos this way 3 times, with different recommended configurations of the nc server to avoid 423. Without success. I tried by starting form scratching, trashing and recreating the user account, with and without server encryption. Nothing fixes or reduces the problem.

Again, happy to contribute additional information or debugging info to help understand and solve the issue.

What’s happening after a few minutes. I just wonder if there might be a cronjob getting activated and using a lot of resources blocking or slowing down the upload. Not sure how this relates in creating the locks.
How to debug? Logs are interesting but there might be a lot of noise. If you just check the system usage during upload, is there something new popping up when the errors start appearing. Regarding the cronjobs, you might increase the running interval, then it should be easily possible to check if the slow down appears at the same moment the cronjobs start.

Nextcloud/Settings/Advanced/Capabilities: In my case the option lock file is not available (despite having redis as file locking cache). Is this enabled in your case?