Deadlock detected oc_filecache

While trying to upload a large folder, I always receive the same error …

OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[40P01]: Deadlock detected: 7 ERROR: deadlock detected DETAIL: Process 1893 waits for ShareLock on transaction 645408; blocked by process 1890. Process 1890 waits for ShareLock on transaction 645429; blocked by process 1893. HINT: See server log for query details. CONTEXT: while updating tuple (84,32) in relation "oc_filecache"

Operating System: Linux 4.4.180+ x86_64

CPU: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz (4 cores)

Memory: 9.57 GB
Version: *8.1.13*
with postgress and redis 
in docker - synology 720+

Any help will be appreciated

You are already using redis, that normally solves many issues with file locking. For uploading large amount of data, there are as well many transactions on the database. For mysql there were a few scripts to check the proper size of your database caches, and adjusting these helps a lot since the default settings are not the best for Nextcloud. Perhaps you find similar things for postgres.

In theory, with redis the file locking is handled independently. However, it might still be linked since if there are delays or timeout on certain transactions, certain file locks might persist…

Just had a look, the VM image move to postgresql some time ago:

They mention a tool to tune postgresql:

1 Like

Thanks for the replaying, but sadly that didn’t fix the problem :frowning: .