You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OCA\DAV\Connector\Sabre\Exception\FileLocked - DB race condition #8239
All files, except "Nextcloud Manual.pdf" gets deleted
I checked my db for the "locked" table, but all files are set to "0"
Yes, this always happens
Yes, this also happend with other files, as well when I tried to rename files
All tests passed and cron works correct
Server configuration
Operating system: Ubuntu 16.04.3 LTS
Web server: Apache/2.4.29
Database: MySQL 5.7.21
PHP version: 7.2.2
Nextcloud version: 13
Updated from an older Nextcloud/ownCloud or fresh install: clean install
Where did you install Nextcloud from: wget, clean install
Logging
OCA\DAV\Connector\Sabre\Exception\FileLocked: "Nextcloud Manual.pdf" is locked
/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179: OCA\DAV\Connector\Sabre\File->delete()
/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 287: Sabre\DAV\Tree->delete('Nextcloud Manua...')
[internal function] Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/cloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method DELETE', Array)
/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/cloud/apps/dav/appinfo/v1/webdav.php - line 80: Sabre\DAV\Server->exec()
/var/www/html/cloud/remote.php - line 164: require_once('/var/www/html/c...')
{main}
I have the same exact issue. Mine started when I removed a directory while it was still syncing. I had to fix the php file size and now if it put it back it won't sync or if I deleted it I can't delete the empty folder on the server. The data store has a bunch of file parts. But the error in the log is the same as above whenever I try and delete the folder in the UI.
Just FYI I fixed it by deleting the file from the filecache table and then deleting the folder manually. Hope that helps you. Then ran scan files for the user to be sure everything was well.
Edit: Seems like I can't use the folder name again. If I do the problem comes back and it won't sync and get the same error above again in the logs.
Same problem since I updated to Nextcloud 13.0.4. Was working fine before. Now if I'm doing some stuff like updating/deleting a file that was just created moments ago, I have this error.
Fixed by adding
'filelocking.enabled' => false,
... but what does that imply? Is it safe to disable file locking?
Same problem since I updated to Nextcloud 13.0.4. Was working fine before.
Exactly the same problem with my nextcloud instance. It also came with the 13.0,4 update. It seems that the error occurs only if a file is synced, which is locked at my local NTFS file system.
I have tried the solution outlined on the Nextcloud forums (https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883) but it doesn't help with our issue. We also tried rebooting the client's machine and rebooting the Nextcloud server to no avail.
Another interesting note is that there are 0 records in the oc_file_locks table but the client is still complaining that the files are locked and new entries are still appearing in the server log.
In my case, I only had one user complaining about this problem so I did these steps manually:
paused their desktop client
moved the folder (and affected files) to another location
deleted the folder/files from the web interface
ran occ files:scan --path="username"
unpaused the client (getting green checkmark at this point)
moved folder back into place and let it sync
At this point there were some complaints from the client, but after waiting a few minutes they cleared themselves
went into redis-cli to check which files were locked, as I use redis on a Unix socket, I ran redis-cli -s /var/run/redis/redis.sock --scan
looked up the file hashes after the fileslocked/ portion of the keys in the oc_filecache table path_hash column (I'm assuming these go together) and confirmed none were present in oc_filecache
deleted those keys from the redis database one at a time: redis-cli -s /var/run/redis/redis.sock
DEL "fullkeyvalue"
Maybe none of the redis stuff I did helped anything, but if I run into this issue again I will start by clearing the keys from redis first to see if that makes any difference as it seems to be the only place left that nobody is talking about here.
Yep, that fix posted above was merged into stable13 on July 10, then 13.0.5 was released on July 23 including the fix. We should probably close this issue.
This just happened here today on 13.0.4. I then updated to 13.0.5 and the uploads are working in the app again. Not sure if this is because of the upgrade process or if latest version did fix it. Will post back if comes up again.
I have these errors spamming the logs with a fresh 14 install via docker upon the first single user attempting to sync files. Fixes or recommendations would be appreciated. Reference setup: https://gitlab.com/deepthought/nextcloud-docker
errors: Fatal | webdav | OCA\DAV\Connector\Sabre\Exception\FileLocked: "..." is locked
result from sudo docker exec --user www-data nextcloud-docker_app_1 php occ config:list system:
Activity
FriedCircuits commentedon Feb 15, 2018
I have the same exact issue. Mine started when I removed a directory while it was still syncing. I had to fix the php file size and now if it put it back it won't sync or if I deleted it I can't delete the empty folder on the server. The data store has a bunch of file parts. But the error in the log is the same as above whenever I try and delete the folder in the UI.
I am on php 7.0 and NC 13.
FriedCircuits commentedon Feb 15, 2018
Just FYI I fixed it by deleting the file from the filecache table and then deleting the folder manually. Hope that helps you. Then ran scan files for the user to be sure everything was well.
Edit: Seems like I can't use the folder name again. If I do the problem comes back and it won't sync and get the same error above again in the logs.
nickvergessen commentedon Feb 22, 2018
are you using database file locking of nextcloud? Please post the output of
./occ config:list systemFriedCircuits commentedon Mar 18, 2018
Sorry for the delay. I haven't seen the error since but in my case it looks like file locking is enabled.
"filelocking.enabled": true,
castillo92 commentedon Mar 31, 2018
Me too, waiting for response.
NextCloud v13.0.1
EDIT:
Well, I fix it adding this line to the config file....
major5012 commentedon Apr 30, 2018
@nickvergessen I have a number of these errors also.
"OCA\DAV\Connector\Sabre\Exception\FileLocked"
NC 13.0.2
PHP 5.6.35
./occ config:list system
dinkonin commentedon Jun 13, 2018
Same problem with Nextcloud 13.0.4 , php 7.1.18 , redis 4.0.9 with this settings
stephanedupont commentedon Jun 16, 2018
Same problem since I updated to Nextcloud 13.0.4. Was working fine before. Now if I'm doing some stuff like updating/deleting a file that was just created moments ago, I have this error.
Fixed by adding
... but what does that imply? Is it safe to disable file locking?
tapete commentedon Jun 17, 2018
Exactly the same problem with my nextcloud instance. It also came with the 13.0,4 update. It seems that the error occurs only if a file is synced, which is locked at my local NTFS file system.
bl4ckOut commentedon Jun 18, 2018
Same here since 13.0.4. Disabling file locking is not a solution for me.
@linucksrox
I can confirm that oc_file_locks table is empty. Only temporary solution which works for me is to:
(currently my repair.sh)
linucksrox commentedon Jun 18, 2018
I have tried the solution outlined on the Nextcloud forums (https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883) but it doesn't help with our issue. We also tried rebooting the client's machine and rebooting the Nextcloud server to no avail.
Another interesting note is that there are 0 records in the oc_file_locks table but the client is still complaining that the files are locked and new entries are still appearing in the server log.
linucksrox commentedon Jun 18, 2018
In my case, I only had one user complaining about this problem so I did these steps manually:
At this point there were some complaints from the client, but after waiting a few minutes they cleared themselves
Maybe none of the redis stuff I did helped anything, but if I run into this issue again I will start by clearing the keys from redis first to see if that makes any difference as it seems to be the only place left that nobody is talking about here.
27 remaining items
tapete commentedon Jul 9, 2018
Ok, I applied the changes in MemcacheLockingProvider.php yesterday and up to now there are no locking errors. Thanks to everyone!
dutchwhizzman commentedon Jul 9, 2018
So what happens next, will it make it to 13.0.5 ?
MorrisJobke commentedon Jul 10, 2018
Yes - it's planned for 13.0.5
dutchwhizzman commentedon Aug 8, 2018
I see 13.0.5 is out. Did this make it to the release?
linucksrox commentedon Aug 8, 2018
Yep, that fix posted above was merged into stable13 on July 10, then 13.0.5 was released on July 23 including the fix. We should probably close this issue.
albertogscotti commentedon Aug 10, 2018
Still have the issue on 13.0.5
Temtaime commentedon Aug 11, 2018
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO
oc_filecache(mimepart,mimetype,mtime,size,etag,storage_mtime,permissions,parent,checksum,path_hash,path,name,storage) SELECT ?,?,?,?,?,?,?,?,?,?,?,?,? FROMoc_filecacheWHEREstorage= ? ANDpath_hash= ? HAVING COUNT(*) = 0' with params ["1", "2", 1533325280, -1, "5b64afe067e8e", 1533325280, 31, 149894, "", "7fc567a03abec499cb8690b5e6b8f337", "files_versions/tools/firmware", "firmware", 1, 1, "7fc567a03abec499cb8690b5e6b8f337"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-7fc567a03abec499cb8690b5e6b8f337' for key 'fs_storage_path_hash'Seems to be related, having this for 13.0.5
jacobHclarkson commentedon Aug 19, 2018
I am having the same issue. Version 13.0.5.
idevwebs commentedon Aug 20, 2018
This just happened here today on 13.0.4. I then updated to 13.0.5 and the uploads are working in the app again. Not sure if this is because of the upgrade process or if latest version did fix it. Will post back if comes up again.
ak1n commentedon Oct 23, 2018
I have these errors spamming the logs with a fresh 14 install via docker upon the first single user attempting to sync files. Fixes or recommendations would be appreciated. Reference setup: https://gitlab.com/deepthought/nextcloud-docker
errors:
Fatal | webdav | OCA\DAV\Connector\Sabre\Exception\FileLocked: "..." is lockedresult from
sudo docker exec --user www-data nextcloud-docker_app_1 php occ config:list system:ak1n commentedon Oct 27, 2018
Seems related: #6160
MorrisJobke commentedon Nov 12, 2018
This kind of stuff is fix in a generic way via #12371 and for this specific one additionally in #12413 (which will also be back ported)