Can not unlock files in Database 18.0.9, postresql 10.14

I can not delete a file - always got an error when try to delete a file. I enabled debugging “‘filelocking.debug’ => true,” and i saw in the logs:
OCP\Lock\LockedException: “xxx/yyy/zzz/rrr/filename.mp4” is locked

*tried to rescan all the files with
sudo -u www-data php occ files:scan --all

-> got error starting
Exception during scan: “files/6bb7e116ce9cdf5c660effe82899eb66” is locked
#0 /var/www/xxx/lib/private/Files/Storage/Common.php(749): OC\Lock\DBLockingProvider->acquireLock(‘files/6bb7e116c…’, 1)

*then i tried according to this “File is locked - how to unlock

DELETE FROM oc_file_locks WHERE 1

and got this error message from the database:
Failed to execute SQL : SQL DELETE FROM oc_file_locks WHERE 1 failed : ERROR: argument of WHERE must be type boolean, not type integer LINE 1: DELETE FROM oc_file_locks WHERE 1 ^

What can i do?

Nextcloud 18.0.9
Ubuntu LTS 1804…
postresql 10.14

1 Like

Now i found a working solution for me…

have an overlook over the locked files…
SELECT * FROM oc_file_locks WHERE oc_file_locks.lock<>0;

strangely i got also “-1” in the lock field…
same as here mentioned->
(Oc_file_lock: understanding values lock field)

…and then delete them - because it where only 4 i did it per hand over my Webmin postgresql interface…

per hand… i think the solution in my case would have been not only deleting the rows with “1” as lock

DELETE FROM nextcloud.oc_file_locks WHERE oc_file_locks.lock > 0;

but also the rows with “-1”

DELETE FROM nextcloud.oc_file_locks WHERE oc_file_locks.lock < 0;

Same here on:

Nextcloud 19.0.3
Debian 9.12
MariaDB 10.1.45

1 Like