Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Had this issue when trying to upload 10k+ files, it starts spewing these errors after a minute or so of copying files that aren’t being actively modified

[webdav] Fatal: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

MKCOL /remote.php/dav/files/Raider/development/financetracker/node_modules/has
from 172.18.0.20 by Raider at 2022-02-25T03:41:34+00:00

Environment (everything as docker containers):
nextcloud (image: nextcloud)
23.0.2

mysql (image: mariadb)
10.6.5
30.4 MB

php
8.0.16
Memory Limit: 512 MB
Max Execution Time: 3600
Upload max size: 512 MB

Things I’ve tried to fix it:
Set this for mariadb
[mysqld]
character_set_server = utf8mb4
collation_server = utf8mb4_general_ci
transaction_isolation = READ-COMMITTED
binlog_format = ROW
innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=1

set:
environment:
- REDIS_HOST=nextcloudredis
in the nextcloudapp container, as per: Docker Hub

Not sure what else I can try to work around this issue.
I saw a comment from 2018 that was similar, but didn’t really have a resolution.
Thank you for any assistance that can be provided.

1 Like

I have the same problem, and it only seems to happen with virtual files. I did a full download of all files and it went okay, I then did a full download of virtual files and it started happening. It doesn’t seem to always be in the same files.