File Locks keep recurring with maintenance mode on

Had locked files…checked manual & KB. Put NC into Maintenance mode, logged into MariaDB, ran DELETE FROM oc_file_locks WHERE 1;

Out of curiosity I ran “select * FROM oc_file_locks” and saw a “1” in the last file. So I ran the DELETE FROM oc_file_locks WHERE 1; and it came back with another 1400 rows affected. Pressed the up cursor and 38 more rows. Kept pressing the up cursor hitting enter & it keeps showing rows affected.

I dont’ think its possible to be in the mariadb console without being in maintenance so I tried accessing nc in a browser and sure enough it says I’m in Maintenance mode.

How are these files being locked with maintenance mode on?

Note: some user do have an owncloud client which syncs files but I thought with maintenance mode on that would block them.

I am using docker so detailed instructions (eli5) would be very appreciated.

I think maintenance mode is only a software (php) feature. You can e.g. activate/deactive it with occ or in config/config.php. I think this has no effect on the locked files marked in the database.

Maybe you can better solve your problem. Read this. What is your goal?

I am not sure. But maybe CRON/AJAX cleans up the file locks. Try running CRON for Nextcloud.

sudo -u www-data php -f /path/to/nextcloud/cron.php

Goal - to del/move files/folders that was giving errors in the browser.
I did try @tflidd suggestion to DELETE FROM oc_file_locks WHERE 1 and it reported affecting over 4,000 files. Good I thought! Double checked results with “select * FROM ocfilelocks;” saw one of the tables had a 1 in it. So ran the Delete command again. Said a few hundred files where affected. Then I just kept repeating the Delete command, everytime new files needed deleting. The longer I waited the more files were locked.

It seems to be locking them as fast as I’m running the “Delete from…” command.
Could a file sync (using owncloud client) be doing this even though I’m in maintenance mode?

I don’t know. But maybe the error is already with the owncloud-client. Why do you not use a Nextcloud client? Disable the owncloud-client or shutdown the affected system with the owncloud-client. You must always try to exclude sources of error in order to narrow down the actual error.