-
-
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
Database Deadlock with Postgres #10473
Comments
I have the same issue here with PostgreSQL. In other databases this error may keep undetected because of missing deadlock detection. It seems, that there is a wrong order of SQL updates in transactions. From the PostgreSQL log:
|
Any update on this? |
I also see errors like this when syncing a lot of files at once, on Nextcloud 15.0.7 with Postgresql 10. However, despite the ugly-looking errors (22 when syncing a directory tree of size 222MB containing ~10k files), everything eventually gets synced correctly. That's OK, but not exactly good. |
Any updates on this? |
🏓 @nextcloud/server-triage |
same issue here, first time user of nextcloud. Issue occurred when I tried to upload a folder of about 1000 files from the web ui, it resulted in the above deadlock errors occuring about 10 times which I had to "X" in the web ui. Using docker postgres:11.3 and nextcloud:16.0.1-apache |
Duplicate of #11136 |
I was able to get this fixed (Debian with Nextcloud 15.0.7 , postgres 11.3-1), by using Redis for Transactional File Locking. This results in reducing DB load and hence no more deadlocks. |
Awesome! Thanks a lot for the feedback! :) |
This issue still happens on Nextcloud 18. This is a bug in Nextcloud. The PostgreSQL error means that clients tried to perform queries in an order that causes a deadlock. If PostgreSQL detects a deadlock it will abort one of the transactions that cause the deadlock. Repeating the transaction that fails could be a possible fix. Using redis is just a workaround: If redis is used, then Nextcloud doesn't use the database and the bug is in the database file locking code. This is is only a duplicate of #11136 if preview generation uses file locking. The SQL tables in this issue and #11136 are different, so it's unlikely to be the same issue. |
happened to me on NC 19.0.1 with PG 12.3 020-07-26 12:55:07.371 UTC [519] STATEMENT: INSERT INTO "oc_filecache_extended" ("fileid", "upload_time") VALUES($1, $2) |
I can see hundreds of those errors within the last hour.
Steps to reproduce
Server configuration
Operating system:
Docker image on Debian host
Web server:
Apache
Database:
Postgres
PHP version:
From official Docker image
Nextcloud version: (see Nextcloud admin page)
Latest from official Docker image
Updated from an older Nextcloud/ownCloud or fresh install:
No
Signing status:
Signing status
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
The text was updated successfully, but these errors were encountered: