-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCA\DAV\Connector\Sabre\Exception\FileLocked - DB race condition #8239
Comments
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. |
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. |
are you using database file locking of nextcloud? Please post the output of |
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, |
Me too, waiting for response. NextCloud v13.0.1 EDIT: Well, I fix it adding this line to the config file....
|
@nickvergessen I have a number of these errors also. "OCA\DAV\Connector\Sabre\Exception\FileLocked" NC 13.0.2 ./occ config:list system
|
Same problem with Nextcloud 13.0.4 , php 7.1.18 , redis 4.0.9 with this settings
|
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? |
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. |
Same here since 13.0.4. Disabling file locking is not a solution for me. @linucksrox
(currently my repair.sh) |
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. |
Can confirm. Still the same error. |
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. |
@nickvergessen , here is output of my config:
I experienced same issue. System:
The only workaround worked was disabling locking: So, do you think the label I'm not sure, what the most correct solution should be, but can think of:
|
I'm not sure if this error came with 13.0.3 or 13.0.4 as I made these updates at the same time. In 13.0.3 there were some changes which might be related to this issue. For example https://github.com/nextcloud/server/pull/9389/files |
Any progress on this issue? |
Same problem too with latest release using redis for locking. Before all was working |
I'd be interested to hear of anyone had success unlocking files by manually deleting the locks out of redis using redis-cli (I explained the steps in an earlier comment). I haven't run into this problem again so I haven't had an opportunity to test that method. |
I can remove locks using redis-cli flushall but the problem comes back |
I too can confirm this happens on 13.0.4 with redis file locking enabled. |
There seems to be also a race condition in the SQL backend: #9305 |
Ok it is back again. Here is the log which includes some minutes before the error occured. Nextcloud log (data/nextcloud.log)Nextcloud log
|
@icewind1991 Could you have a look at those logs? |
I do not exactly know how to test #10116. It looks to me like I need to change the file: and create a new file: If I do so I get the error: PHP Fatal error: Declaration of OC\Lock\MemcacheLockingProvider::isLocked(string $path, int $type): bool must be compatible with OCP\Lock\ILockingProvider::isLocked($path, $type) in /var/www/html/nextcloud/lib/private/Lock/MemcacheLockingProvider.php on line 30 Am I wrong? |
@tapete I was able to successfully apply the changes in #10116 on a recent 13.0.4 install. This corrected locking issues I've been seeing which appeared similar to yours. Did you copy and paste the entire file from #10116 or only modify the affected lines? My copy of MemcacheLockingProvider.php does not define parameter types for any of the included functions, which might be the cause of the new problem you're experiencing. |
@circletile How did you apply these changes? I replaced the file lib/private/Lock/MemcacheLockingProvider.php by the one provided in #10116. But I was confused with the second file. There is no such file in my installation. So I created a new file: tests/lib/Lock/LockingProvider.php like shown in #10116. In the end, it did not work. |
Don't fully replace MemcacheLockingProvider.php, only modify the changed lines as indicated in the diff. You can probably ignore LockingProvider.php (I did) as it appears to be for build testing. Better to check with a project dev for a definitive answer on that one however. |
Yes - the one in tests/ is not needed. And it's also correct, that only the changes should be added and not the whole file. In the next days we also will try to backport the changes to the stable13 branch so that it will be included in the upcoming 13.0.5 release. |
Ok, I applied the changes in MemcacheLockingProvider.php yesterday and up to now there are no locking errors. Thanks to everyone! |
So what happens next, will it make it to 13.0.5 ? |
Yes - it's planned for 13.0.5 |
I see 13.0.5 is out. Did this make it to the release? |
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. |
Still have the issue on 13.0.5 |
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO Seems to be related, having this for 13.0.5 |
I am having the same issue. Version 13.0.5. |
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: result from
|
Seems related: #6160 |
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) |
Steps to reproduce
Expected behaviour
All files should be deleted
Actual behaviour
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
The text was updated successfully, but these errors were encountered: