File locked: How to resolve mysql nc_file_locks entrys

I have a nextloud 19.0.2 instance which has at least one locked file.
I tried to repair it with the occ tool without success(occ files:scan -all + cleanup did not find anything).

I found ~10 entrys in my mysql db nc_file_locks in the format:
119506 3 files/200ece41304bcadad29f928f9b5173d1 1598954562

How can I convert these entries into file names?
Which database contains the file names?


Sorry no real idea. But perhaps you can dump the database and use full search.

mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak

but I already did several searches in phpMyAdmin without success.

Years ago i used MySQLDumper.
Yo need a database dump also for backup/restore.

What is your memcache set to?

Make a backup of your nc_file_locks.
turn on maintenance mode
delete all in nc_file_locks
occ files:scan -all
sudo -u www php -f cron.php

taken from this Unlock files

1 Like

I have solved this as you suggested, but now I have 8 locked files reset instead of one.
I would also have been interested to know which other files were locked.

I cannot help you there but looking in my oc_file_locks there are [(39.561)] files locked with lock 0.

I could not care why as they will be released when ttl runs out.

I openend 1 document on the cloud office it created 8 entries in the lock table. I cannot imagine that there are 8 files locked.

As i said I do not know how to see which file there correspond to.

Having the same problem as @tester and @Vincent_Stans in that I also could not correlate entries within the database table nc_file_locks to actual file names.

Perhaps I am not seeing things clearly @Vincent_Stans, but running the files:scan --all command in occ seems to cause more problems than it is worth:

Does @tester and anyone else happen to experience the same issue posted in Increasing the database size when scanning as well?