Fix webdav mount sync error - can't delete directory

Dear community, I’m running NC18 on a raspberryPi:

Nextcloud version: 18
Operating system and version: Raspbian Buster
Apache version: 2.4
PHP version: 7.3

I then mounted the webdav directory in macOS using Mountain Duck, and uploaded several folders to NC data directory. One folder was, however, marked as not synced in my Webdav client, and as such I tried to delete it using the same client.

When I do so, the folder (and some of its files) re-appear in my webdav client, meaning it’s not able to delete them. I also visited NC web interface and tried deleting the folder from them, also with no success (i get the error “error eliminating file” in the top right corner with no further help on what’s wrong).

I assume something must be wrong in NC database? How can I troubleshoot / fix these inconsistencies? I have access to the OCC command. Also, my data folder is located on an external mount, owned by www-data:www-data.


After some research I found that it was an issue with file locks in the NC database. Removing those entries from the database solved the issues.