I get that same error too for one of my users, tried to do occ files:cleanup but it did not help (0 orphaned file cache entries deleted)
How do we go about this issue?
Instructions is in the first post
Yes of course, and I already did manually disable the locking state beforehand. I had this a while ago already, thatâs where I started using redis, but the problem seems to persist
MariaDB says: Query OK, 0 rows affected (0.01 sec)
fsck.ext4 says that everything is fine
Report it on github, seems this is a bug
crazy, and nextcloud even seems to show files on the web-ui that are not there on the disk - even after a occ files:scan --all
âŚok, I guess Iâll report it. Thanks though!
Hi amo13
I had the same Problems a few times. But I could always fix it with this procedure (retain the order!):
- occ âfiles:scan --allâ
- occ âfiles:cleanupâ
- occ âmaintenance:mode --onâ
- mysql -u root -pâinheregoesyourpasswordâ -D ocdb -e âdelete from oc_file_locks where 1â
- occ âmaintenance:mode --offâ
- restart your Nextcloud webserver and try again -> the files in your web-ui should be gone.
Good Luck, Cheers zisuu
This works for me
@tflidd, your manual does not work for me on Ubuntu 16.04.1 server x64 with Nextcloud 13.0.2
Yes, i found FileLocked in nextcloud.log
.
Yes, i have redis and apcu installed
config.php:
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'memcache.local' => '\\OC\\Memcache\\APCu',
'redis' => array (
'host' => 'localhost',
'port' => 6379,
),
Yes, i have emptied the table oc_file_locks
âmaintenanceâ => true,
DELETE FROM oc_file_locks WHERE 1
âmaintenanceâ => false,
Yes, i executed the cron job manually after disabling maintainance mode without any errors
sudo -u www-data php -f /var/www/nextcloud/cron.php
Nevertheless those files are still locked and oc_file_locks
is empty.
Can you please explain that behavior or what is to do?
Thank you!
BTW: Why donât add an admin option in the GUI for deleting the file lock?
Give your services/server a bounce (restart). May just be a locked process or something untoward.
The steps outlined by @tflidd will manually force any file locks to be removed by dropping them from the database forcibly. This should normally be taken care of by the system but as is clearly demonstrated throughout the thread it isnât foolproof.
Sorry i forgot to mention that i did a restart of redis and apache already:
service redis restart
service apache2 restart
But this did not unlock the files.
Bounce the server. Could it be theyâre locked by something else? Another process on the server accessing the file for some reason or somethingâŚ
I donât think so because iâm the only user of the server. Itâs hosted on localhost in a virtual machine.
Meanwhile i could remove the file lock by setting
'filelocking.enabled' => false,
temporarely, with the success that the Windows desktop sync client canât sync the folder in question anymore.
Strange!
Provide full screenshot to see the ending of the file then we might help you more
Itâs a directory with 2 PDF files inside.
It is the directory which was locked before.
The ignored file list of the desktop sync client does not contain any pdf files and i did not alter it.
Did you try to delete the keys in the redis database ?
On Centos with a socket connection :
sudo redis-cli -s /var/run/redis/redis.sock flushall
Itâs quite radical, but works for me.
Thank you! This worked for me. By the way, Iâm running Nextcloud in an iocage jail on FreeNAS, so I changed www-data to www
By the way, your config.php file has to be in ordinary mode (not maintenance mode).
For anyone having issues with files getting lock while using redis on nextcloud pi. Specially while syncing nodejs appsâŚ
- Connect to your redis
sudo redis-cli -s /var/run/redis/redis.sock - authenticate in your redis with the password for redis found in /var/www/nextcloud/config/config.php
$> auth âyourpasswordfoundinconfig.phpâ
$> flushall
Your locked files should synchronize now
This error/bug has been driving me crazy. Because there was so much variety in the user posts, I created a more standardized testing environment and replicated the bug with a standardized dataset on clean new installs using both postgres & mysql. In the process I created a one-run install script that requires minimal configuration/expertise to use. Doing the file/redis maintenance options are not actually solutions if the bug is evident on clean installs (they merely temporize the issue). Any recommendations on where to look (e.g. in nextcloud codebase) to get this bug fixed would be appreciated!
I want to see nextcloud succeed, and for it to do so this issue needs fixing!
Install script/writeup: https://gitlab.com/deepthought/nextcloud-docker/tree/latest
For freenas users (script not as good, worse deadlock errors): https://github.com/ak1n/freenas-iocage-nextcloud
I had the same problem and I solved this by updating values on table oc_file_locks. I found some values diferent from 0 like 1 and -1. Alter this and be happy.