-
-
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
DeadlockException executing UPDATE oc_filecache
#22482
Comments
There are several issues like this like #15047, but it clears seems a new problem introduced in 19.0.2 as it affects all our instances with different setups after upgrading from 19.0.1. We can reproduce it but uploading many files (30) to a folder then select them all and delete. Some of them will produce a Deadlock. Filelocking is enabled on Redis. I'm using MariaBD 10.4. Detailed output
Cc @nextcloud/server-triage |
oc_filecache
@acsfer Yup I only get it then I select alot of file within a folder to delete. Idk why this is happening but this should be looked at and fixed! I got worried that my database got corrupt and I build a new server and still the same issue so definitely not a my server instance your anyone else that's having the issue out there. |
This comment has been minimized.
This comment has been minimized.
Came here to say that I have the same problem with ALL instances of NC right after upgrading to 19.0.2. Even performed a fresh installation of 19.0.2 - the problem is still here. After some debugging, I found it only happens if I try to delete multiple files at once. If I delete the same files one after one, everything works perfectly. But select them all - and deadlock message is here... |
Another update: the issue exists even after adding "'filelocking.enabled' => false" line to config file. |
Yeah the message is not from the file locking feature, but from a database lock |
Cc @icewind1991 @rullzer anything changed in filesystem recently with regards to that? |
I get various forms of DeadlockException almost every time I sync files (last time I wrote a comment about it: #10473 (comment)). I guess it's finally happening with MySQL as well. There are quite a few issues related to these errors (#11136, #15047, #21537). These errors are not dangerous by themselves. The error means that 2 database transactions could not be executed at the same time and one of them got cancelled ( see https://en.wikipedia.org/wiki/Deadlock ). Retrying that transaction should be enough, but Nextcloud does not seem to handle these errors at all. DeadlockExceptions can only happen when multiple requests are made to the Nextcloud server at the same time, so testing requires adding/removing multiple files, not just one. It should also only happen on queries that read/modify multiple rows. My most recent DeadlockException:
|
@APTX Thank you for the detailed info, hopefully the dev team can figure something out. |
Not sure this helps, but these are the queries (along with the back traces) which seem to trigger this for me: UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?)
UPDATE `oc_filecache` SET `size` = ?
UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?))
|
+1 on tthe issue. I seem to be unable to delete folders that contain subfolders since the update. Doing so will make the linux desktop sync-client throw errors at me for hours at which point I just killed the sync client for now... Doing a scan --all now with the hope it will fix things. |
This comment has been minimized.
This comment has been minimized.
#22563 may fix this. Feedback welcome. |
Just applied patch 4a3f6a7 to nextcloud 19.0.2 and restarted apache2. Trying to delete multiple files at once still gives the same error messages. |
This comment has been minimized.
This comment has been minimized.
Output of MariaDB
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Same problems here, on 19.0.2 and mysql. This bug also occurs when a Windows sync client reads files from a server (w/o any write operations). This is a production system, so I cannot install a patch, but I'm happy to provide more (debugging) information if required. |
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions. |
Still happening on 25.0.3. NC log:
Corresponding MariaDB transaction log:
|
I am also seeing these issues more often again since upgrading from 24.0.9 to 25.0.3
I should have waited with the major upgrade, given all the issues with v25 :( After a few seconds, the client syncs again and then it usually works. I am on 32GB Xeon Server Hardware, with Raidz2 on ZFS. |
I've also had this issue, and perhaps coincidentally I'm also on ZFS running raidz2. |
@andyxheli @simonspa |
See #37820 |
Thanks @solracsf keeping fingers 🤞. Hopefully this dose the trick. |
Without any knowledge of the code, would it be possible to use semaphores or such to prevent deadlocks from ever occurring? Reducing the probability of a deadlock occurring sounds like a mitigating measure, which is good, but perhaps not enough to write the issue off altogether? EDIT: Say you batch upload some 10 000 files in the Web UI and the issue occurs in 1% of the uploaded files, or even 0.1%, it will be quite messy to find out which portion of the files that is in order to maintain data integrity. |
just left a comment to this here to explain why this happes imo: #29985 (comment) |
Hi, there have been patches to address this issue that will land in 26.0.3. Can you please verify if 26.0.3-rc1 improves the situation around this issue? |
Just curious if you mean this patch? Unless I'm mistaken, this appears to just be ignoring the deadlock exception. If that's the case, while this may remove the deadlock error from the logs, it leaves another error and doesn't actually solve the problem as laid out by @obel1x. It also still leaves the errors in the database logs.
|
See #6899 (comment) |
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions. |
Still an issue on NC 27.0.2 |
Same problem on NC 28.0.2 |
Same on NC 29.0.2... |
Can we please get this issue reopened as the issue still happens on 29.0.2 |
How to use GitHub
Report
Getting the following error when deleting files. I even setup a new Nextcloud 19.0.2 server and still same issue. Seems to be related with photo files more then docs.
I've already ran
Already checked the oc_filecache table; and no issues there based on the output of mysql.
The text was updated successfully, but these errors were encountered: