nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.15k stars 4.03k forks source link

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

Closed mxschmitt closed 1 year ago

mxschmitt commented 6 years ago

Steps to reproduce

  1. Reinstalled fresh nextcloud
  2. Idk what I did. My webdav client was syncing files with the official nextcloud client parallel.

Expected behaviour

No error

Actual behaviour

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT ?,?,? FROM `oc_file_locks` WHERE `key` = ? HAVING COUNT(*) = 0' with params ["files\/b7aec8354372d9ccd750400d8d03800f", 1, 1508666706, "files\/b7aec8354372d9ccd750400d8d03800f"]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
/var/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
/var/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1015: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO `oc...', Array)
/var/www/cloud/lib/private/DB/Connection.php - line 213: Doctrine\DBAL\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)
/var/www/cloud/lib/private/DB/Adapter.php - line 114: OC\DB\Connection->executeUpdate('INSERT INTO `oc...', Array)
/var/www/cloud/lib/private/DB/Connection.php - line 251: OC\DB\Adapter->insertIfNotExist('*PREFIX*file_lo...', Array, Array)
/var/www/cloud/lib/private/Lock/DBLockingProvider.php - line 118: OC\DB\Connection->insertIfNotExist('*PREFIX*file_lo...', Array, Array)
/var/www/cloud/lib/private/Lock/DBLockingProvider.php - line 163: OC\Lock\DBLockingProvider->initLockField('files/b7aec8354...', 1)
/var/www/cloud/lib/private/Files/Storage/Common.php - line 704: OC\Lock\DBLockingProvider->acquireLock('files/b7aec8354...', 1)
/var/www/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 588: OC\Files\Storage\Common->acquireLock('files/01-Arbeit...', 1, Object(OC\Lock\DBLockingProvider))
/var/www/cloud/lib/private/Files/View.php - line 1908: OC\Files\Storage\Wrapper\Wrapper->acquireLock('files/01-Arbeit...', 1, Object(OC\Lock\DBLockingProvider))
/var/www/cloud/lib/private/Files/View.php - line 2018: OC\Files\View->lockPath('01-Arbeit/01-Be...', 1, false)
/var/www/cloud/lib/private/Files/View.php - line 1309: OC\Files\View->lockFile('01-Arbeit/01-Be...', 1)
/var/www/cloud/lib/private/Files/View.php - line 1356: OC\Files\View->getCacheEntry(Object(OCA\Files_Trashbin\Storage), 'files/01-Arbeit...', '01-Arbeit/01-Be...')
/var/www/cloud/apps/dav/lib/Connector/Sabre/ObjectTree.php - line 160: OC\Files\View->getFileInfo('/maxibanki/file...')
/var/www/cloud/apps/dav/lib/Connector/Sabre/LockPlugin.php - line 59: OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath('01-Arbeit/01-Be...')
[internal function] OCA\DAV\Connector\Sabre\LockPlugin->getLock(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/cloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466: Sabre\Event\EventEmitter->emit('beforeMethod', Array)
/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/cloud/apps/dav/appinfo/v1/webdav.php - line 76: Sabre\DAV\Server->exec()
/var/www/cloud/remote.php - line 162: require_once('/var/www/cloud....')
{main}

Server configuration

Operating system: Debian 9.1 PXE:

Web server: nginx/1.10.3

Database: MariaDB

PHP version: 7.1.9

Nextcloud version: 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Fresh Install

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/nextcloud-12.0.3.zip

Signing status:

Signing status `No errors have been found.`

List of activated apps:

App list ``` Enabled: - activity: 2.5.2 - bruteforcesettings: 1.0.2 - comments: 1.2.0 - dav: 1.3.0 - federatedfilesharing: 1.2.0 - federation: 1.2.0 - files: 1.7.2 - files_pdfviewer: 1.1.1 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_trashbin: 1.2.0 - files_versions: 1.5.0 - files_videoplayer: 1.1.0 - firstrunwizard: 2.1 - gallery: 17.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.1 - notifications: 2.0.0 - oauth2: 1.0.5 - password_policy: 1.2.2 - provisioning_api: 1.2.0 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - survey_client: 1.0.0 - systemtags: 1.2.0 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - updatenotification: 1.2.0 - workflowengine: 1.2.0 Disabled: - admin_audit - encryption - files_external - user_external - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "ocqw4m1v6kk0", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud" ], "datadirectory": "\/var\/www\/cloud\/data", "overwrite.cli.url": "https:\/\/cloud", "dbtype": "mysql", "version": "12.0.3.3", "dbname": "nextcloud", "dbhost": "10.10.10.6", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "mail_from_address": "cloud", "mail_smtpmode": "php", "mail_smtpauthtype": "LOGIN", "mail_domain": "schmitt.mx" } } ```

Are you using external storage, if yes which one: local/smb/sftp/.. No.

Are you using encryption: No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... Only webdav

Client configuration

Browser: Chrome 62

Operating system: Windows 7 Enterprise

Logs

Web server error log

Web server error log ``` No relevant logs ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` { "reqId": "aGDjWevMFpuYXpWX3mH7", "level": 4, "time": "2017-10-22T08:38:10+00:00", "remoteAddr": "", "user": "maxibanki", "app": "webdav", "method": "PUT", "url": "\/remote.php\/webdav\/01-Arbeit\/01-Berufsschule\/00-Archiv\/Steinam-XSLTalt\/.git\/objects\/f1\/08a244c01ab24b81e8a17bf0576734776a3e81", "message": "Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT ?,?,? FROM `oc_file_locks` WHERE `key` = ? HAVING COUNT(*) = 0' with params [\\\"files\\\\\\\/3d31700630071b7bfc95805f8a422ab1\\\", 1, 1508665090, \\\"files\\\\\\\/3d31700630071b7bfc95805f8a422ab1\\\"]:\\n\\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(128): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1015): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'INSERT INTO `oc...', Array)\\n#2 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/Connection.php(213): Doctrine\\\\DBAL\\\\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)\\n#3 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/Adapter.php(114): OC\\\\DB\\\\Connection->executeUpdate('INSERT INTO `oc...', Array)\\n#4 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/Connection.php(251): OC\\\\DB\\\\Adapter->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\\n#5 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Lock\\\/DBLockingProvider.php(118): OC\\\\DB\\\\Connection->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\\n#6 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Lock\\\/DBLockingProvider.php(163): OC\\\\Lock\\\\DBLockingProvider->initLockField('files\\\/3d3170063...', 1)\\n#7 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Common.php(704): OC\\\\Lock\\\\DBLockingProvider->acquireLock('files\\\/3d3170063...', 1)\\n#8 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(588): OC\\\\Files\\\\Storage\\\\Common->acquireLock('files\\\/01-Arbeit...', 1, Object(OC\\\\Lock\\\\DBLockingProvider))\\n#9 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/View.php(1908): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('files\\\/01-Arbeit...', 1, Object(OC\\\\Lock\\\\DBLockingProvider))\\n#10 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/View.php(2022): OC\\\\Files\\\\View->lockPath('\\\/01-Arbeit\\\/01-B...', 1)\\n#11 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/View.php(1309): OC\\\\Files\\\\View->lockFile('01-Arbeit\\\/01-Be...', 1)\\n#12 \\\/var\\\/www\\\/cloud\\\/lib\\\/private\\\/Files\\\/View.php(1356): OC\\\\Files\\\\View->getCacheEntry(Object(OCA\\\\Files_Trashbin\\\\Storage), 'files\\\/01-Arbeit...', '01-Arbeit\\\/01-Be...')\\n#13 \\\/var\\\/www\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(160): OC\\\\Files\\\\View->getFileInfo('\\\/maxibanki\\\/file...')\\n#14 \\\/var\\\/www\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/LockPlugin.php(59): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('01-Arbeit\\\/01-Be...')\\n#15 [internal function]: OCA\\\\DAV\\\\Connector\\\\Sabre\\\\LockPlugin->getLock(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#16 \\\/var\\\/www\\\/cloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#17 \\\/var\\\/www\\\/cloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#18 \\\/var\\\/www\\\/cloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#19 \\\/var\\\/www\\\/cloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(76): Sabre\\\\DAV\\\\Server->exec()\\n#20 \\\/var\\\/www\\\/cloud\\\/remote.php(162): require_once('\\\/var\\\/www\\\/cloud....')\\n#21 {main}\",\"File\":\"\\\/var\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":116}", "userAgent": "--", "version": "12.0.3.3" } ```

Browser log

Not relevant

Schmuuu commented 5 years ago

I tested again with the NC desktop client and with the Web GUI. Both ways worked perfectly fine and the whole package has been uploaded/ synched flawlessly. No deadlocks and no other messages in the NC log (log level = Info). So regarding the previous error during synchronization, it was definitely an issue with the Win10 app.

I'm sorry I didn't write earlier. It was the higher activity in the issue which drew my attention now.

kesselb commented 5 years ago

When you are running mariadb/mysql could you enable https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_print_all_deadlocks? More information about the deadlock should be in the error log then. Please post it 👍

Greek64 commented 5 years ago

@danielkesselberg I don't know about others, but when I had deadlocks - in the sense that nextcloud said they were deadlocks in the logs - my database was of a different opinion (I also have the option already set)

Here a quote from my previous post:

The interesting thing is, that when I try to find the root cause of the Deadlock, the mysql database has not detected any deadlocks. Normally executing SHOW ENGINE INNODB STATUS in the mysql database, outputs a section called "LATEST DETECTED DEADLOCK", which analyzes the two Quaries that lead to the Deadlock. But my database does not detect (or better said report) any Deadlock that is caused by the nextcloud client syncing. On the other hand, when I try to make a manual Deadlock, it is reported as expected.

kesselb commented 5 years ago

Thank you for clarification. @MorrisJobke @rullzer @nickvergessen i was wondering why nextcloud is using an old doctrine/dbal version? I guess they made some improvments (e.g https://github.com/doctrine/dbal/pull/718) to deadlocks with newer version. https://github.com/doctrine/dbal/pull/2422 has been merged a while ago.

obel1x commented 5 years ago

i still got that error on nc 14 + mariadb + linux client when uploading a lot of files many times. For me it looked like Statement "insert ... select" on the same table doesn't work fine in adapter.php - the doc of mysql says that i won't work at all. When i look at the issues, postgres is also affected, but more likely causes duplicate entries. To find out if the Statement was the issue, i did a quick workaround-version, as to find in my post of #6160 -> After those Changes for my no more Deadlocks.

Anyone who can test this Version on a testing Server? If so, pleas check my testing-Version and let me know if it solves that for you too. Regards, Daniel

rullzer commented 5 years ago

Thank you for clarification. @MorrisJobke @rullzer @nickvergessen i was wondering why nextcloud is using an old doctrine/dbal version? I guess they made some improvments (e.g doctrine/dbal#718) to deadlocks with newer version. doctrine/dbal#2422 has been merged a while ago.

Because doctrine required php 7.1 starting at 2.6 and we still support php 7.0

kesselb commented 5 years ago

@obel1x thank you for investigating :+1:

I can confirm that the query below (which is the one generated by insertIfNotExist) leads to a deadlock with mariadb.

INSERT INTO `oc_filecache` (`mimepart`,`mimetype`,`mtime`,`size`,`etag`,`storage_mtime`,`permissions`,`parent`,`checksum`,`path_hash`,`path`,`name`,`storage`) SELECT '1','2','1541450083','-1','5be0afd65dd46','1541450083','31','305','','ad7abceaf8133707e29be350c4326422','appdata_ocy132w80pwx/css/files_trashbin','files_trashbin','2' FROM `oc_filecache` WHERE `storage` = '2' AND `path_hash` = 'ad7abceaf8133707e29be350c4326422' HAVING COUNT(*) = 0;

Howto collect more information

1) truncate oc_filecache 2) breakpoint in https://github.com/nextcloud/server/blob/a661f043e1a8764cb7c795f50df77b830d3e352b/lib/private/Files/Cache/Cache.php#L271 3) use scanner to trigger filecache again

kesselb commented 5 years ago

On my instance there is an unique index on storage and path_hash. If this is true for every instance i would use insert ignore (to avoid the select before insert) and use the query builder here: https://github.com/nextcloud/server/blob/a661f043e1a8764cb7c795f50df77b830d3e352b/lib/private/Files/Cache/Cache.php#L271

MorrisJobke commented 5 years ago

insert ignore

Is this supported on all DBs? (sqlite, Postgres, MariaDB, mysql and oracle)

obel1x commented 5 years ago

Thank you for the confirm. For me this seems to be the reason for a bunch of issues (see 6160) even making people think that nc is not good enough for production. I also had the problem, that if that Error occurred a few times on a specific file the sync won't work any more at all. Have you tried my (3rd) version in Test? For me, this works without any errors, even if it is not nice to have. So maybe someone ca clean it up and bring it up to the next version?

The second proposal "Insert Ignore": that would be great but well - it seems that the changed function "insertIfNotExist" has intentionally not been designed to use indices, as compare-columns are given by and they don't have to be equal to any index. as far as i have seen, it will be called in different scenarios and on different tables (eg. file_locks if no redis/memchache), so we cannot ensure there is an corresponding index. So currently i would not know how to circumvent the select if not running into Deadlocks. On the other hand - i am pretty sure that i saw selects to the tables after that function. So if i were nc developer i would see to change the return of the Function to include the results any way and to use them later on so prevent multiple selects to that table. Only a suggestion. Unfortunately i am in lack of knowledge and tools to have a look where this function is called from.

So lets first stick to some workaround. Anyone here to help us further?

MorrisJobke commented 5 years ago

Thank you for clarification. @MorrisJobke @rullzer @nickvergessen i was wondering why nextcloud is using an old doctrine/dbal version? I guess they made some improvments (e.g doctrine/dbal#718) to deadlocks with newer version. doctrine/dbal#2422 has been merged a while ago.

Do we want to port it to our dbal version and add this here?

$retryWrapper = new RetryWrapper(function () use ($con) {
    return $con->update('tablename', array('field' => 'data'), array('id' => 'myid'));
});

$affectedRows = $retryWrapper();
obel1x commented 5 years ago

are those dbal-changes (they are taking the sql-errorcode into more precise exceptions, right?) and Retrywrapper to solve the deadlock or a general proposal? I would not recommend doing retries with that query as a solution for the deadlocks - now if we know the cause for the issues is the query itself and that it can be worked around. As i said before: i had that error that many times, that files were blocked out. So it very likely that retries will fail too in those setups.

mduller commented 5 years ago

I just converted from MariaDB to Postgres and can also confirm that I haven't seen any deadlocks anymore. Even @adocampo 's test file syncs without any issues. I think the Retrywrapper can be a good intermediate solution until the queries are rewritten and tested. Most important, though, is that error messages are being printed when files are silently ignored. When still on MariaDB, this was not the case for me in Firefox for a couple NC versions now (see my earlier post).

kesselb commented 5 years ago

insert ignore

Is this supported on all DBs? (sqlite, Postgres, MariaDB, mysql and oracle)

No :disappointed:

MorrisJobke commented 5 years ago

Part of the issues that were posted in here are most likely fixed by the change in #12366. The crucial point is that the stack trace contains initLockField. If this is the case, then the linked PR fixes most likely this issue. For the others I'm about to look into it.

MorrisJobke commented 5 years ago

I posted and overview in #12368 with details about the different stack traces and what you need to look for to find the one you are looking into.

The one that was posted by the OP is solved in #12366

MorrisJobke commented 5 years ago

The one that was posted by the OP is solved in #12366

There is a new version of this in #12371. Maybe you want to test this as well. It should solve at least all UniqueConstraintViolationExceptions.

MorrisJobke commented 5 years ago

The deadlocks for the "INSERT INTO" are fixed by #12411 (for the table oc_filecache) and #12413 (for the table oc_file_locks).

avimanyu786 commented 3 years ago

This issue just reappeared for me(first attempt only) when I tried to upload a folder consisting of multiple sub-directories having files and pictures from the Ubuntu Desktop to Firefox browser running NC on web. I'm using mariadb:10.5.2 and nextcloud:22.1.0 based on the recommended Docker Compose settings on the server. If I delete the partial upload and try again, I keep getting Connection to server lost and An unknown error has occurred resulting once again in an incomplete upload.

VozDeOuro commented 3 years ago

This issue just reappeared for me(first attempt only) when I tried to upload a folder consisting of multiple sub-directories having files and pictures from the Ubuntu Desktop to Firefox browser running NC on web. I'm using mariadb:10.5.2 and nextcloud:22.1.0 based on the recommended Docker Compose settings on the server. If I delete the partial upload and try again, I keep getting Connection to server lost and An unknown error has occurred resulting once again in an incomplete upload.

i'm getting those errors too. did you got a fix for it ?

adocampo commented 3 years ago

As I said back in 2018, do NOT use mysql/mariadb but PostgreSQL. I had not a single error since I changed the DB engine.

IPlayZed commented 2 years ago

As I said back in 2018, do NOT use mysql/mariadb but PostgreSQL. I had not a single error since I changed the DB engine.

Is there a safe way to convert? This still exists for me even tough it is supposed to be fixed.

adocampo commented 2 years ago

Is there a safe way to convert? This still exists for me even tough it is supposed to be fixed.

As I did a lot of tests, I finally screw my installation and decided to install NC from scratch, but @enoch85 shared a link to convert mariadb to postgresql. If you only have files on your NC instance, I would install a brand new NC and PGSQL/redis instead of migrating from mariadb, though.

RobMahn commented 2 years ago

I also had this problem. I changed MariaDB to Postgres and have had no problems. I'm wondering why the recommended installation is MariaDB when this problem has not been resolved for over 4 years.

Server configuration detail

Operating system: Linux 5.10.0-13-686-pae #1 SMP Debian 5.10.106-1 (2022-03-17) i686 Webserver: nginx/1.18.0 (fpm-fcgi) Database: pgsql PostgreSQL 13.5 (Debian 13.5-0+deb11u1) on i686-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 32-bit PHP version: 8.0.18 Nextcloud version: 23.0.4 - 23.0.4.1

nderambure commented 2 years ago

Still getting this bug on large uploads through the browser in 23.X and 24 versions. Any update on this ? Thx !

nexhub commented 2 years ago

@nderambure Same here on 23.0.4

Redsandro commented 2 years ago

I don't think issues like this (issues that remain active long after being closed) get enough attention.

Nextcloud is very feature rich and clearly a lot of effort went into making it enterprise-ready with comprehensive commercial support options. But when elemental issues with the documented setup can remain without a satisfactory explanation for half a dozen years across multiple versions, Nextcloud risks appearing like a perpetual beta. Not 23.0.4 but 9.23.4-beta.

Using PostgreSQL works around the issue, but no one knows why. For everyone still running into trouble wishing to use MariaDB (perhaps because a lot of guides are based on the docker-setup as proposed by Nextcloud) be advised that multiple commits have been merged to docker-compose.yml since the beginning of this issue so make sure you use the latest one and report back if it fixes your issue. If you're just starting from scratch, it's probably a safer bet to start again using PostgreSQL.

AndyXheli commented 2 years ago

Issues back on Nextcloud 24.0.1

{"reqId":"bEFxDLMOCxcGfiIdTLd3","level":3,"time":"2022-06-02T14:22:50+00:00","remoteAddr":"1.1.1.1","user":"admin","app":"no app in context","method":"PUT","url":"/remote.php/dav/files/admin/Photos/2020/07/20-02-14%2012-17-00%200665.jpg","message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","userAgent":"Mozilla/5.0 (Macintosh) mirall/3.5.1git (build 10326) (Nextcloud, osx-21.5.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.1.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DeadlockException","Message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1173,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":380,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":328,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":948,"function":"writeUpdate","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/LegacyVersionsBackend.php","line":93,"function":"copy","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php","line":92,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\LegacyVersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":217,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\VersionManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Hooks.php","line":56,"function":"store","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"write_hook","class":"OCA\\Files_Versions\\Hooks","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":438,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":178,"function":"emitPreHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":37,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":380,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":328,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":948,"function":"writeUpdate","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/LegacyVersionsBackend.php","line":93,"function":"copy","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php","line":92,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\LegacyVersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":217,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\VersionManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Hooks.php","line":56,"function":"store","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"write_hook","class":"OCA\\Files_Versions\\Hooks","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":438,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":178,"function":"emitPreHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":"40001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":380,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":328,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":948,"function":"writeUpdate","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/LegacyVersionsBackend.php","line":93,"function":"copy","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php","line":92,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\LegacyVersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":217,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\VersionManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Hooks.php","line":56,"function":"store","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"write_hook","class":"OCA\\Files_Versions\\Hooks","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":438,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":178,"function":"emitPreHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"CustomMessage":"--"},"id":"6298d812186f5"}
vasyugan commented 2 years ago

I guess this needs to be reopened. This is what I see:

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

/var/www/cloud.******/lib/private/DB/ConnectionAdapter.php - line 109:

OC\DB\Exceptions\DbalException::wrap()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 132:

OC\DB\ConnectionAdapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 178:

OC\Lock\DBLockingProvider->initLockField()

/var/www/cloud.******/lib/private/Files/Storage/Common.php - line 758:

OC\Lock\DBLockingProvider->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Common->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/SharedStorage.php - line 474:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OCA\Files_Sharing\SharedStorage->acquireLock()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 149:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/Scanner.php - line 78:

OC\Files\Cache\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 438:

OCA\Files_Sharing\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 390:

OC\Files\Cache\Scanner->handleChildren()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 342:

OC\Files\Cache\Scanner->scanChildren()

/var/www/cloud.******/lib/private/Files/View.php - line 1350:

OC\Files\Cache\Scanner->scan()

/var/www/cloud.******/lib/private/Files/View.php - line 1390:

OC\Files\View->getCacheEntry()

/var/www/cloud.******/apps/dav/lib/Connector/Sabre/Directory.php - line 231:

OC\Files\View->getFileInfo()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 78:

OCA\DAV\Connector\Sabre\Directory->getChild()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 76:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

Sabre\DAV\CorePlugin->httpGet()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

Sabre\DAV\Server->emit()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

Sabre\DAV\Server->invokeMethod()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

Sabre\DAV\Server->start()

/var/www/cloud.******/apps/dav/lib/Server.php - line 352:

Sabre\DAV\Server->exec()

/var/www/cloud.******/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/cloud.******/remote.php - line 166:

require_once("/var/www/ch ... p")

Verursacht durch Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Connection.php - line 1780:

Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Connection.php - line 1719:

Doctrine\DBAL\Connection->handleDriverException()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Connection.php - line 1173:

Doctrine\DBAL\Connection->convertExceptionDuringQuery()

/var/www/cloud.******/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/cloud.******/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Adapter.php - line 146:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Connection.php - line 360:

OC\DB\Adapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/DB/ConnectionAdapter.php - line 107:

OC\DB\Connection->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 132:

OC\DB\ConnectionAdapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 178:

OC\Lock\DBLockingProvider->initLockField()

/var/www/cloud.******/lib/private/Files/Storage/Common.php - line 758:

OC\Lock\DBLockingProvider->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Common->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/SharedStorage.php - line 474:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OCA\Files_Sharing\SharedStorage->acquireLock()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 149:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/Scanner.php - line 78:

OC\Files\Cache\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 438:

OCA\Files_Sharing\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 390:

OC\Files\Cache\Scanner->handleChildren()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 342:

OC\Files\Cache\Scanner->scanChildren()

/var/www/cloud.******/lib/private/Files/View.php - line 1350:

OC\Files\Cache\Scanner->scan()

/var/www/cloud.******/lib/private/Files/View.php - line 1390:

OC\Files\View->getCacheEntry()

/var/www/cloud.******/apps/dav/lib/Connector/Sabre/Directory.php - line 231:

OC\Files\View->getFileInfo()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 78:

OCA\DAV\Connector\Sabre\Directory->getChild()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 76:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

Sabre\DAV\CorePlugin->httpGet()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

Sabre\DAV\Server->emit()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

Sabre\DAV\Server->invokeMethod()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

Sabre\DAV\Server->start()

/var/www/cloud.******/apps/dav/lib/Server.php - line 352:

Sabre\DAV\Server->exec()

/var/www/cloud.******/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/cloud.******/remote.php - line 166:

require_once("/var/www/ch ... p")

Verursacht durch Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 94:

Doctrine\DBAL\Driver\PDO\Exception::new()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Connection.php - line 1163:

Doctrine\DBAL\Driver\PDO\Statement->execute()

/var/www/cloud.******/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/cloud.******/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Adapter.php - line 146:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Connection.php - line 360:

OC\DB\Adapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/DB/ConnectionAdapter.php - line 107:

OC\DB\Connection->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 132:

OC\DB\ConnectionAdapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 178:

OC\Lock\DBLockingProvider->initLockField()

/var/www/cloud.******/lib/private/Files/Storage/Common.php - line 758:

OC\Lock\DBLockingProvider->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Common->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/SharedStorage.php - line 474:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OCA\Files_Sharing\SharedStorage->acquireLock()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 149:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/Scanner.php - line 78:

OC\Files\Cache\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 438:

OCA\Files_Sharing\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 390:

OC\Files\Cache\Scanner->handleChildren()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 342:

OC\Files\Cache\Scanner->scanChildren()

/var/www/cloud.******/lib/private/Files/View.php - line 1350:

OC\Files\Cache\Scanner->scan()

/var/www/cloud.******/lib/private/Files/View.php - line 1390:

OC\Files\View->getCacheEntry()

/var/www/cloud.******/apps/dav/lib/Connector/Sabre/Directory.php - line 231:

OC\Files\View->getFileInfo()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 78:

OCA\DAV\Connector\Sabre\Directory->getChild()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 76:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

Sabre\DAV\CorePlugin->httpGet()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

Sabre\DAV\Server->emit()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

Sabre\DAV\Server->invokeMethod()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

Sabre\DAV\Server->start()

/var/www/cloud.******/apps/dav/lib/Server.php - line 352:

Sabre\DAV\Server->exec()

/var/www/cloud.******/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/cloud.******/remote.php - line 166:

require_once("/var/www/ch ... p")

Verursacht durch PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 92:

PDOStatement->execute()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Connection.php - line 1163:

Doctrine\DBAL\Driver\PDO\Statement->execute()

/var/www/cloud.******/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/cloud.******/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/cloud.******/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Adapter.php - line 146:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/cloud.******/lib/private/DB/Connection.php - line 360:

OC\DB\Adapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/DB/ConnectionAdapter.php - line 107:

OC\DB\Connection->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 132:

OC\DB\ConnectionAdapter->insertIgnoreConflict()

/var/www/cloud.******/lib/private/Lock/DBLockingProvider.php - line 178:

OC\Lock\DBLockingProvider->initLockField()

/var/www/cloud.******/lib/private/Files/Storage/Common.php - line 758:

OC\Lock\DBLockingProvider->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Common->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/SharedStorage.php - line 474:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610:

OCA\Files_Sharing\SharedStorage->acquireLock()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 149:

OC\Files\Storage\Wrapper\Wrapper->acquireLock()

/var/www/cloud.******/apps/files_sharing/lib/Scanner.php - line 78:

OC\Files\Cache\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 438:

OCA\Files_Sharing\Scanner->scanFile()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 390:

OC\Files\Cache\Scanner->handleChildren()

/var/www/cloud.******/lib/private/Files/Cache/Scanner.php - line 342:

OC\Files\Cache\Scanner->scanChildren()

/var/www/cloud.******/lib/private/Files/View.php - line 1350:

OC\Files\Cache\Scanner->scan()

/var/www/cloud.******/lib/private/Files/View.php - line 1390:

OC\Files\View->getCacheEntry()

/var/www/cloud.******/apps/dav/lib/Connector/Sabre/Directory.php - line 231:

OC\Files\View->getFileInfo()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 78:

OCA\DAV\Connector\Sabre\Directory->getChild()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 76:

Sabre\DAV\Tree->getNodeForPath()

/var/www/cloud.******/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

Sabre\DAV\CorePlugin->httpGet()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

Sabre\DAV\Server->emit()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

Sabre\DAV\Server->invokeMethod()

/var/www/cloud.******/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

Sabre\DAV\Server->start()

/var/www/cloud.******/apps/dav/lib/Server.php - line 352:

Sabre\DAV\Server->exec()

/var/www/cloud.******/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/cloud.******/remote.php - line 166:

require_once("/var/www/ch ... p")``
AndyXheli commented 2 years ago

Same here NC 24.0.2 I did a 30GB folder upload via web and got alot of these messages

{"reqId":"TYCcgIInVPaHE8jftTvM","level":4,"time":"2022-06-29T20:12:25+00:00","remoteAddr":"10.0.0.1","user":"admin","app":"webdav","method":"PUT","url":"/remote.php/webdav/Photos/2022/01/22-01-27%2012-37-26%206459.jpg","message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36","version":"24.0.2.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DeadlockException","Message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1173,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":382,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":369,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":83,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":37,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":382,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":369,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":83,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":"40001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":382,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":145,"function":"update","class":"OC\\Files\\Cache\\Cache","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":256,"function":"update","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":138,"function":"correctParentStorageMtime","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":369,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":83,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"CustomMessage":"--"},"id":"62bcb2304a8f8"}
jstet commented 2 years ago

same here

enoch85 commented 2 years ago

Please use 👍 in the first post if you're affected.

Thanks!

ministry-of-code commented 2 years ago

We are facing the same problem with the latest Version of Nextcloud running in Docker (nextcloud:24.0.2-apache). When a huge amount of files are being uploaded, we see a lot of the following log entries:

Jul 16 05:49:15 localhost nextcloud[1247]: [Sat Jul 16 05:49:15.539376 2022] [php:notice] [pid 82] [client 217.110.53.26:0] [owncloud][webdav][4] {"Exception":"Doctrine\\\\DBAL\\\\Exception\\\\DeadlockException","Message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\\\DBAL\\\\Driver\\\\API\\\\MySQL\\\\ExceptionConverter","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1173,"function":"convertExceptionDuringQuery","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/Propagator.php","line":104,"function":"execute","class":"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/HomePropagator.php","line":48,"function":"propagateChange","class":"OC\\\\Files\\\\Cache\\\\Propagator","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/Updater.php","line":139,"function":"propagateChange","class":"OC\\\\Files\\\\Cache\\\\HomePropagator","type":"->"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":369,"function":"update","class":"OC\\\\Files\\\\Cache\\\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\\\DAV\\\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":166,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":37,"Previous":{"Exception":"Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Exception","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Exception","type":"::"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Statement","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/Propagator.php","line":104,"function":"execute","class":"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/HomePropagator.php","line":48,"function":"propagateChange","class":"OC\\\\Files\\\\Cache\\\\Propagator","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/Updater.php","line":139,"function":"propagateChange","class":"OC\\\\Files\\\\Cache\\\\HomePropagator","type":"->"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":369,"function":"update","class":"OC\\\\Files\\\\Cache\\\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\\\DAV\\\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":352,"function":"exec","class":"Sabre\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\\\DAV\\\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":166,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":"40001","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Statement","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/Propagator.php","line":104,"function":"execute","class":"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/Files/Cache/HomePropagator.php","line":48,"function":"propagateChange","class":"OC\\

MariaDB is using the config option transaction_isolation = READ-COMMITTED

Would be great if someone could have a look at it and fix the problem.

Sieboldianus commented 2 years ago

I have the same issue with the official Docker Nextcloud 23.07 apache image, while uploading a large number of new files for a new user, using the desktop client (18215 files). I had about 25 transaction deadlocks "1213".

This is syncing over the local network (100mbit), but my Server is hardly used, I don't see high I/O: image

Maybe this is a sign that I should finally migrate my Nextcloud from MariaDB to Postgres, which looks like the superior database.

My trace also includes correctParentStorageMtime:

log ```log Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction /var/www/html/3rdparty/doctrine/dbal/src/Connection.php - line 1780: Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert(Doctrine\DBA ... {}, Doctrine\DBAL\Query {}) /var/www/html/3rdparty/doctrine/dbal/src/Connection.php - line 1719: Doctrine\DBAL\Connection->handleDriverException(Doctrine\DBA ... {}, Doctrine\DBAL\Query {}) /var/www/html/3rdparty/doctrine/dbal/src/Connection.php - line 1173: Doctrine\DBAL\Connection->convertExceptionDuringQuery(Doctrine\DBA ... {}, "UPDATE `oc_ ... )", [ 1659272417 ... 7], [ 2,2,1,2,2]) /var/www/html/lib/private/DB/Connection.php - line 270: Doctrine\DBAL\Connection->executeStatement("UPDATE `oc_ ... )", [ 1659272417 ... 7], [ 2,2,1,2,2]) /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354: OC\DB\Connection->executeStatement("UPDATE `oc_ ... )", [ "*** sensi ... 7], [ 1,2,2,2,2]) /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php - line 287: Doctrine\DBAL\Query\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Cache.php - line 379: OC\DB\QueryBuilder\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Wrapper/CacheWrapper.php - line 145: OC\Files\Cache\Cache->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 256: OC\Files\Cache\Wrapper\CacheWrapper->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 138: OC\Files\Cache\Updater->correctParentStorageMtime("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/File.php - line 366: OC\Files\Cache\Updater->update("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 155: OCA\DAV\Connector\Sabre\File->put(null) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1098: OCA\DAV\Connector\Sabre\Directory->createFile("icon-60@3x.png", null) /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 504: Sabre\DAV\Server->createFile("files/alex- ... g", null, null) /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89: Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 472: Sabre\DAV\Server->emit("method:PUT", [ Sabre\HTTP ... }]) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 253: Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 321: Sabre\DAV\Server->start() /var/www/html/apps/dav/lib/Server.php - line 339: Sabre\DAV\Server->exec() /var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec() /var/www/html/remote.php - line 166: require_once("/var/www/ht ... p") Caused by Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction /var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 94: Doctrine\DBAL\Driver\PDO\Exception::new(PDOException ... ]}) /var/www/html/3rdparty/doctrine/dbal/src/Connection.php - line 1163: Doctrine\DBAL\Driver\PDO\Statement->execute() /var/www/html/lib/private/DB/Connection.php - line 270: Doctrine\DBAL\Connection->executeStatement("UPDATE `oc_ ... )", [ 1659272417 ... 7], [ 2,2,1,2,2]) /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354: OC\DB\Connection->executeStatement("UPDATE `oc_ ... )", [ "*** sensi ... 7], [ 1,2,2,2,2]) /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php - line 287: Doctrine\DBAL\Query\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Cache.php - line 379: OC\DB\QueryBuilder\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Wrapper/CacheWrapper.php - line 145: OC\Files\Cache\Cache->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 256: OC\Files\Cache\Wrapper\CacheWrapper->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 138: OC\Files\Cache\Updater->correctParentStorageMtime("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/File.php - line 366: OC\Files\Cache\Updater->update("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 155: OCA\DAV\Connector\Sabre\File->put(null) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1098: OCA\DAV\Connector\Sabre\Directory->createFile("icon-60@3x.png", null) /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 504: Sabre\DAV\Server->createFile("files/alex- ... g", null, null) /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89: Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 472: Sabre\DAV\Server->emit("method:PUT", [ Sabre\HTTP ... }]) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 253: Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 321: Sabre\DAV\Server->start() /var/www/html/apps/dav/lib/Server.php - line 339: Sabre\DAV\Server->exec() /var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec() /var/www/html/remote.php - line 166: require_once("/var/www/ht ... p") Caused by PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction /var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 92: PDOStatement->execute(null) /var/www/html/3rdparty/doctrine/dbal/src/Connection.php - line 1163: Doctrine\DBAL\Driver\PDO\Statement->execute() /var/www/html/lib/private/DB/Connection.php - line 270: Doctrine\DBAL\Connection->executeStatement("UPDATE `oc_ ... )", [ 1659272417 ... 7], [ 2,2,1,2,2]) /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354: OC\DB\Connection->executeStatement("UPDATE `oc_ ... )", [ "*** sensi ... 7], [ 1,2,2,2,2]) /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php - line 287: Doctrine\DBAL\Query\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Cache.php - line 379: OC\DB\QueryBuilder\QueryBuilder->execute() /var/www/html/lib/private/Files/Cache/Wrapper/CacheWrapper.php - line 145: OC\Files\Cache\Cache->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 256: OC\Files\Cache\Wrapper\CacheWrapper->update("*** sensiti ... *") /var/www/html/lib/private/Files/Cache/Updater.php - line 138: OC\Files\Cache\Updater->correctParentStorageMtime("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/File.php - line 366: OC\Files\Cache\Updater->update("*** sensiti ... *") /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 155: OCA\DAV\Connector\Sabre\File->put(null) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1098: OCA\DAV\Connector\Sabre\Directory->createFile("icon-60@3x.png", null) /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 504: Sabre\DAV\Server->createFile("files/alex- ... g", null, null) /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89: Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 472: Sabre\DAV\Server->emit("method:PUT", [ Sabre\HTTP ... }]) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 253: Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {}) /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 321: Sabre\DAV\Server->start() /var/www/html/apps/dav/lib/Server.php - line 339: Sabre\DAV\Server->exec() /var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec() /var/www/html/remote.php - line 166: require_once("/var/www/ht ... p") ```
PVince81 commented 2 years ago

for those who see acquireLock in the stack trace, please make sure to use Redis for file locking instead of the default, because the default is the database. see instructions here: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/files_locking_transactional.html

for those already using Redis, let's continue to gather stack traces to see if there's a common pattern in the places where it happens.

code paths seen so far on the reports in NC >= 24:

if everyone sees it happen in "correctParentStorageMtime" then this could be the bottleneck

dvaerum commented 2 years ago

I used SHOW ENGINE INNODB STATUS in the MySQL database and I found this LATEST DETECTED DEADLOCK. I read that this was something people could not find at the beginning of the issue. So, I wanted to share it. I don't know if this helps.

Note: My setup is using Redis, my NC version is "23.0.7.2", database is MariaDB-1:10.8.3

+--------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+--------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InnoDB |      |
=====================================
2022-08-07 10:44:45 0x7f41a460a640 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 6 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 531803 srv_idle
srv_master_thread log flush and writes: 531658
----------
SEMAPHORES
----------
------------------------
LATEST DETECTED DEADLOCK
------------------------
2022-08-05 09:40:15 0x7f4196e86640
*** (1) TRANSACTION:
TRANSACTION 1210281846, ACTIVE 0 sec updating or deleting
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 3 row lock(s), undo log entries 1
MariaDB thread id 80832, OS thread handle 139919681414720, query id 9970100 10.14.129.6 nextcloud Updating
UPDATE `oc_filecache` SET `size` = GREATEST(`size` + '10485760', -1) WHERE (`storage` = 10) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '5128f35c9b4be13788ba41bdb6d1fc1f', 'dd6b85faaaba8e960dabaeabd00fb6aa')) AND (`size` > '-1')
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 22 page no 9132 n bits 536 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 1210281846 lock_mode X locks rec but not gap waiting
Record lock, heap no 512 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 800000000004633d; asc       c=;;
 1: len 8; hex 800000000000000a; asc         ;;
 2: len 8; hex 8000000000a08000; asc         ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 22 page no 9132 n bits 536 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 1210281847 lock_mode X locks rec but not gap
Record lock, heap no 512 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 800000000004633d; asc       c=;;
 1: len 8; hex 800000000000000a; asc         ;;
 2: len 8; hex 8000000000a08000; asc         ;;

*** (2) TRANSACTION:
TRANSACTION 1210281847, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 80843, OS thread handle 139919669335616, query id 9970103 10.14.129.6 nextcloud Updating
UPDATE `oc_filecache` SET `mtime` = '1659692415', `storage_mtime` = '1659692415' WHERE (`fileid` = 287549) AND (((`mtime` <> '1659692415') OR (`mtime` IS NULL)) OR ((`storage_mtime` <> '1659692415') OR (`storage_mtime` IS NULL)))
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 22 page no 5414 n bits 56 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 1210281847 lock_mode X locks rec but not gap waiting
Record lock, heap no 51 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 800000000004633d; asc       c=;;
 1: len 6; hex 000048236f76; asc   H#ov;;
 2: len 7; hex 7f000001781e1c; asc     x  ;;
 3: len 8; hex 800000000000000a; asc         ;;
 4: len 7; hex 75706c6f616473; asc uploads;;
 5: len 30; hex 353132386633356339623462653133373838626134316264623664316663; asc 5128f35c9b4be13788ba41bdb6d1fc; (total 32 bytes);
 6: len 8; hex 800000000000c9c9; asc         ;;
 7: len 7; hex 75706c6f616473; asc uploads;;
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 8000000001408000; asc      @  ;;
 11: len 8; hex 8000000062ece57f; asc     b   ;;
 12: len 8; hex 8000000062ece57e; asc     b  ~;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36326563653537663338653437; asc 62ece57f38e47;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 22 page no 5414 n bits 56 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 1210281846 lock_mode X locks rec but not gap
Record lock, heap no 51 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 800000000004633d; asc       c=;;
 1: len 6; hex 000048236f76; asc   H#ov;;
 2: len 7; hex 7f000001781e1c; asc     x  ;;
 3: len 8; hex 800000000000000a; asc         ;;
 4: len 7; hex 75706c6f616473; asc uploads;;
 5: len 30; hex 353132386633356339623462653133373838626134316264623664316663; asc 5128f35c9b4be13788ba41bdb6d1fc; (total 32 bytes);
 6: len 8; hex 800000000000c9c9; asc         ;;
 7: len 7; hex 75706c6f616473; asc uploads;;
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 8000000001408000; asc      @  ;;
 11: len 8; hex 8000000062ece57f; asc     b   ;;
 12: len 8; hex 8000000062ece57e; asc     b  ~;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36326563653537663338653437; asc 62ece57f38e47;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** WE ROLL BACK TRANSACTION (0)
------------
TRANSACTIONS
------------
Trx id counter 1214464932
Purge done for trx's n:o < 1214464818 undo n:o < 0 state: running
History list length 574
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION (0x7f41b41c1680), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f41b41c0b80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f41b41c3780), ACTIVE 0 sec fetching rows
mysql tables in use 1, locked 0
0 lock struct(s), heap size 1128, 0 row lock(s)
MariaDB thread id 132910, OS thread handle 139919683970624, query id 38780669 10.14.129.6 nextcloud Sending data
SELECT SUM(`size`) AS `f1`, MIN(`size`) AS `f2` FROM `oc_filecache` WHERE (`storage` = 1) AND (`parent` = 72)
Trx read view will not see trx with id >= 1214464926, sees < 1214464926
---TRANSACTION (0x7f41b41c2180), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f41b41c2c80), ACTIVE 0 sec
mysql tables in use 2, locked 0
0 lock struct(s), heap size 1128, 0 row lock(s)
MariaDB thread id 127660, OS thread handle 139920505763392, query id 38780729 10.14.129.6 nextcloud Statistics
SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `permissions`, `checksum`, `metadata_etag`, `creation_time`, `upload_time` FROM `oc_filecache` `filecache` LEFT JOIN `oc_filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` WHERE (`storage` = 2) AND (`path_hash` = 'd41d8cd98f00b204e9800998ecf8427e')
--------
FILE I/O
--------
Pending flushes (fsync): 0
132713 OS file reads, 5175096 OS file writes, 5062463 OS fsyncs
6.33 reads/s, 8192 avg bytes/read, 97.32 writes/s, 97.32 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 129, seg size 131, 0 merges
merged operations:
 insert 0, delete mark 0, delete 0
discarded operations:
 insert 0, delete mark 0, delete 0
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 1459767295545
Log flushed up to   1459767295545
Pages flushed up to 1459744353626
Last checkpoint at  1459744353626
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 167772160
Dictionary memory allocated 1180072
Buffer pool size   8064
Free buffers       0
Database pages     6934
Old database pages 2539
Modified db pages  2095
Percent of dirty pages(LRU & free pages): 30.209
Max dirty pages percent: 90.000
Pending reads 0
Pending writes: LRU 0, flush list 0
Pages made young 1990305, not young 3138124
44.49 youngs/s, 18.33 non-youngs/s
Pages read 132558, created 25120, written 118135
6.33 reads/s, 0.17 creates/s, 0.00 writes/s
Buffer pool hit rate 999 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 6934, unzip_LRU len: 4223
I/O sum[612]:cur[13], unzip sum[3068]:cur[76]
--------------
ROW OPERATIONS
--------------
1 read views open inside InnoDB
Process ID=0, Main thread ID=0, state: sleeping
Number of rows inserted 100937, updated 4979865, deleted 28845, read 5323554052
2.00 inserts/s, 99.82 updates/s, 0.50 deletes/s, 170215.80 reads/s
Number of system rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
 |
+--------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
IPlayZed commented 2 years ago

@andyxheli could you please format your comment's logs with code tags? The logs are unreadable like that.

AndyXheli commented 2 years ago

@andyxheli could you please format your comment's logs with code tags? The logs are unreadable like that.

Done :)

TheWojtek commented 2 years ago

Same here. SHOW ENGINE INNODB STATUS result:

InnoDB      
=====================================
2022-08-16 21:38:26 0x7f87e00ac640 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 26 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 303475 srv_idle
srv_master_thread log flush and writes: 303402
----------
SEMAPHORES
----------
------------------------
LATEST DETECTED DEADLOCK
------------------------
2022-08-16 07:13:09 0x7f87c8367640
*** (1) TRANSACTION:
TRANSACTION 884132, ACTIVE 0 sec updating or deleting
mysql tables in use 1, locked 1
LOCK WAIT 6 lock struct(s), heap size 1128, 5 row lock(s), undo log entries 2
MariaDB thread id 10396, OS thread handle 140221156324928, query id 353827 cloud.dromost 192.168.0.3 cloud Updating
UPDATE `oc_filecache` SET `size` = GREATEST(`size` + '1345149', -1) WHERE (`storage` = 3) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'a53ba038ba3fd771f2133a6947a9b6b4', '72da6bc37f8b5177d391a4560042d26f', '8baab410b5e6bb1614fd887841ff6eaa', 'b63aa25805dc3ec282eef270945147ec', 'd97c6fa99db303a668b4c35f6851a6cd', '47f58bbd0fa8f9fc6837eff9f4a1a3d9')) AND (`size` > '-1')
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 82 page no 1484 n bits 552 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 884132 lock_mode X locks rec but not gap waiting
Record lock, heap no 515 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 800000000000b83c; asc        <;;
 1: len 8; hex 8000000000000003; asc         ;;
 2: len 8; hex 80000000004c8d65; asc      L e;;

*** CONFLICTING WITH:
RECORD LOCKS space id 82 page no 1484 n bits 552 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 884134 lock_mode X locks rec but not gap
Record lock, heap no 515 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 800000000000b83c; asc        <;;
 1: len 8; hex 8000000000000003; asc         ;;
 2: len 8; hex 80000000004c8d65; asc      L e;;

*** (2) TRANSACTION:
TRANSACTION 884134, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 10397, OS thread handle 140221178213952, query id 353829 cloud.dromost 192.168.0.3 cloud Updating
UPDATE `oc_filecache` SET `mtime` = '1660633989', `storage_mtime` = '1660633989' WHERE (`fileid` = 47164) AND (((`mtime` <> '1660633989') OR (`mtime` IS NULL)) OR ((`storage_mtime` <> '1660633989') OR (`storage_mtime` IS NULL)))
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 82 page no 1666 n bits 72 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 884134 lock_mode X locks rec but not gap waiting
Record lock, heap no 35 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 800000000000b83c; asc        <;;
 1: len 6; hex 0000000d7da4; asc     } ;;
 2: len 7; hex 67000001f40e7b; asc g     {;;
 3: len 8; hex 8000000000000003; asc         ;;
 4: len 30; hex 66696c65732f53772e4d617263696e5f322e335f695f322e342f30315f57; asc files/Sw.Marcin_2.3_i_2.4/01_W; (total 99 bytes);
 5: len 30; hex 343766353862626430666138663966633638333765666639663461316133; asc 47f58bbd0fa8f9fc6837eff9f4a1a3; (total 32 bytes);
 6: len 8; hex 800000000000b82f; asc        /;;
 7: len 6; hex 303220504446; asc 02 PDF;;
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 80000000006113e2; asc      a  ;;
 11: len 8; hex 8000000062fb4385; asc     b C ;;
 12: len 8; hex 8000000062fb4385; asc     b C ;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36326662343338353365653335; asc 62fb43853ee35;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 82 page no 1666 n bits 72 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 884132 lock_mode X locks rec but not gap
Record lock, heap no 35 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 800000000000b83c; asc        <;;
 1: len 6; hex 0000000d7da4; asc     } ;;
 2: len 7; hex 67000001f40e7b; asc g     {;;
 3: len 8; hex 8000000000000003; asc         ;;
 4: len 30; hex 66696c65732f53772e4d617263696e5f322e335f695f322e342f30315f57; asc files/Sw.Marcin_2.3_i_2.4/01_W; (total 99 bytes);
 5: len 30; hex 343766353862626430666138663966633638333765666639663461316133; asc 47f58bbd0fa8f9fc6837eff9f4a1a3; (total 32 bytes);
 6: len 8; hex 800000000000b82f; asc        /;;
 7: len 6; hex 303220504446; asc 02 PDF;;
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 80000000006113e2; asc      a  ;;
 11: len 8; hex 8000000062fb4385; asc     b C ;;
 12: len 8; hex 8000000062fb4385; asc     b C ;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36326662343338353365653335; asc 62fb43853ee35;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** WE ROLL BACK TRANSACTION (0)
------------
TRANSACTIONS
------------
Trx id counter 955404
Purge done for trx's n:o < 955404 undo n:o < 0 state: running but idle
History list length 7
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION (0x7f87cb9c2330), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f87cb9c0130), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f87cb9c1230), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
--------
FILE I/O
--------
Pending flushes (fsync) log: 0; buffer pool: 0
61574 OS file reads, 152551 OS file writes, 149366 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 62, seg size 64, 0 merges
merged operations:
 insert 0, delete mark 0, delete 0
discarded operations:
 insert 0, delete mark 0, delete 0
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 1351378114
Log flushed up to   1351378114
Pages flushed up to 1334457189
Last checkpoint at  1334457053
0 pending log flushes, 0 pending chkp writes
149211 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 167772160
Dictionary memory allocated 1157192
Buffer pool size   8112
Free buffers       1
Database pages     13209
Old database pages 4856
Modified db pages  745
Percent of dirty pages(LRU & free pages): 5.639
Max dirty pages percent: 90.000
Pending reads 0
Pending writes: LRU 0, flush list 0
Pages made young 17087, not young 3246599
0.00 youngs/s, 0.00 non-youngs/s
Pages read 61425, created 945, written 3316
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 13209, unzip_LRU len: 1320
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 read views open inside InnoDB
Process ID=0, Main thread ID=0, state: sleeping
Number of rows inserted 6914, updated 138866, deleted 690, read 4350960
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.08 reads/s
Number of system rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================

NextCloud 24.0.4, MariaDB 10.6.7-MariaDB-2ubuntu1.1 Running Ubuntu 22.04

AndyXheli commented 2 years ago

Got this on NC 25 while restoring files from Recycling bin

{"reqId":"1UyqG0PpE0HTjQoNcNuQ","level":3,"time":"2022-09-14T16:18:52+00:00","remoteAddr":"10.99.0.65","user":"admin","app":"webdav","method":"MOVE","url":"/remote.php/dav/trashbin/axheli/trash/Update%20Pick%20List.pdf.d1587062361","message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36","version":"25.0.0.11","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DeadlockException","Message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1173,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":709,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":629,"function":"moveFromCache","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":198,"function":"move","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","line":168,"function":"renameFromStorage","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":64,"function":"restoreItem","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/AbstractTrash.php","line":93,"function":"restoreItem","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/RestoreFolder.php","line":75,"function":"restore","class":"OCA\\Files_Trashbin\\Sabre\\AbstractTrash","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":160,"function":"moveInto","class":"OCA\\Files_Trashbin\\Sabre\\RestoreFolder","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":37,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":1213,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":709,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":629,"function":"moveFromCache","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":198,"function":"move","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","line":168,"function":"renameFromStorage","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":64,"function":"restoreItem","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/AbstractTrash.php","line":93,"function":"restoreItem","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/RestoreFolder.php","line":75,"function":"restore","class":"OCA\\Files_Trashbin\\Sabre\\AbstractTrash","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":160,"function":"moveInto","class":"OCA\\Files_Trashbin\\Sabre\\RestoreFolder","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":"40001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":281,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":709,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":629,"function":"moveFromCache","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":198,"function":"move","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","line":168,"function":"renameFromStorage","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":64,"function":"restoreItem","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/AbstractTrash.php","line":93,"function":"restoreItem","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/RestoreFolder.php","line":75,"function":"restore","class":"OCA\\Files_Trashbin\\Sabre\\AbstractTrash","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":160,"function":"moveInto","class":"OCA\\Files_Trashbin\\Sabre\\RestoreFolder","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"message":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","exception":[],"CustomMessage":"An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"},"id":"6321ff05a9fac"}
szaimen commented 1 year ago

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

TheWojtek commented 1 year ago

25.0.2 still displays the same behavior (running 10.6.11-MariaDB-0ubuntu0.22.04.1):

| InnoDB |      | 
=====================================
2023-01-10 13:58:17 0x7fec653a9640 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 56 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 317809 srv_idle
srv_master_thread log flush and writes: 317691
----------
SEMAPHORES
----------
------------------------
LATEST DETECTED DEADLOCK
------------------------
2023-01-09 09:08:51 0x7fec6535e640
*** (1) TRANSACTION:
TRANSACTION 14586864, ACTIVE 0 sec updating or deleting
mysql tables in use 1, locked 1
LOCK WAIT 12 lock struct(s), heap size 1128, 11 row lock(s), undo log entries 5
MariaDB thread id 6741, OS thread handle 140653287040576, query id 340462 cloud.dromost.pl 192.168.0.3 cloud Updating
UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, 1673251731), `etag` = '63bbcb93a6a63', `size` = CASE WHEN `size` > '-1' THEN GREATEST(`size` + '3423415', -1) ELSE `size` END WHERE (`storage` = 2) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '4af905e50a7f3980627a75b910733fb8', '89adc5a69eb1f0672daf1d179491aa7c', 'd751a754e21031f4bfc3c53e544bad34', '516d06bf5e1d6f7cdd8a53277d1dfc55', '9c15493c2cb43fbb48b5eb16c48b93f6'))
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 82 page no 4008 n bits 392 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 14586864 lock_mode X locks rec but not gap waiting
Record lock, heap no 389 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 80000000000245b8; asc       E ;;
 1: len 8; hex 8000000000000002; asc         ;;
 2: len 8; hex 80000000001a99be; asc         ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 82 page no 4008 n bits 392 index fs_id_storage_size of table `nextcloud`.`oc_filecache` trx id 14586867 lock_mode X locks rec but not gap
Record lock, heap no 389 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 80000000000245b8; asc       E ;;
 1: len 8; hex 8000000000000002; asc         ;;
 2: len 8; hex 80000000001a99be; asc         ;;

*** (2) TRANSACTION:
TRANSACTION 14586867, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 6742, OS thread handle 140653536077376, query id 340467 cloud.dromost.pl 192.168.0.3 cloud Updating
UPDATE `oc_filecache` SET `mtime` = '1673251731', `storage_mtime` = '1673251731' WHERE (`fileid` = 148920) AND (((`mtime` <> '1673251731') OR (`mtime` IS NULL)) OR ((`storage_mtime` <> '1673251731') OR (`storage_mtime` IS NULL)))
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 82 page no 5059 n bits 16 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 14586867 lock_mode X locks rec but not gap waiting
Record lock, heap no 7 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 80000000000245b8; asc       E ;;
 1: len 6; hex 000000de93f0; asc       ;;
 2: len 7; hex 0f000002a21c15; asc        ;;
 3: len 8; hex 8000000000000002; asc         ;;
 4: len 30; hex 66696c65732f4543312f335fc5b972c3b364c582612f315f4d6170792f61; asc files/EC1/3_  r  d  a/1_Mapy/a; (total 91 bytes);
 5: len 30; hex 396331353439336332636234336662623438623565623136633438623933; asc 9c15493c2cb43fbb48b5eb16c48b93; (total 32 bytes);
 6: len 8; hex 800000000000559c; asc       U ;;
 7: len 30; hex 323032322e31322e31395f6d61706120646f6461746b6f7761202d206b61; asc 2022.12.19_mapa dodatkowa - ka; (total 48 bytes);
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 80000000004ed675; asc      N u;;
 11: len 8; hex 8000000063bbcb93; asc     c   ;;
 12: len 8; hex 8000000063bbcb93; asc     c   ;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36336262636239336136613633; asc 63bbcb93a6a63;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 82 page no 5059 n bits 16 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 14586864 lock_mode X locks rec but not gap
Record lock, heap no 7 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
 0: len 8; hex 80000000000245b8; asc       E ;;
 1: len 6; hex 000000de93f0; asc       ;;
 2: len 7; hex 0f000002a21c15; asc        ;;
 3: len 8; hex 8000000000000002; asc         ;;
 4: len 30; hex 66696c65732f4543312f335fc5b972c3b364c582612f315f4d6170792f61; asc files/EC1/3_  r  d  a/1_Mapy/a; (total 91 bytes);
 5: len 30; hex 396331353439336332636234336662623438623565623136633438623933; asc 9c15493c2cb43fbb48b5eb16c48b93; (total 32 bytes);
 6: len 8; hex 800000000000559c; asc       U ;;
 7: len 30; hex 323032322e31322e31395f6d61706120646f6461746b6f7761202d206b61; asc 2022.12.19_mapa dodatkowa - ka; (total 48 bytes);
 8: len 8; hex 8000000000000002; asc         ;;
 9: len 8; hex 8000000000000001; asc         ;;
 10: len 8; hex 80000000004ed675; asc      N u;;
 11: len 8; hex 8000000063bbcb93; asc     c   ;;
 12: len 8; hex 8000000063bbcb93; asc     c   ;;
 13: len 4; hex 80000000; asc     ;;
 14: len 8; hex 8000000000000000; asc         ;;
 15: len 13; hex 36336262636239336136613633; asc 63bbcb93a6a63;;
 16: len 4; hex 8000001f; asc     ;;
 17: len 0; hex ; asc ;;

*** WE ROLL BACK TRANSACTION (2)
------------
TRANSACTIONS
------------
Trx id counter 14717102
Purge done for trx's n:o < 14717102 undo n:o < 0 state: running but idle
History list length 8
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION (0x7fec741c0b80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
--------
FILE I/O
--------
Pending flushes (fsync) log: 0; buffer pool: 0
132972 OS file reads, 170068 OS file writes, 166750 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.41 writes/s, 0.41 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 62, seg size 64, 0 merges
merged operations:
 insert 0, delete mark 0, delete 0
discarded operations:
 insert 0, delete mark 0, delete 0
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 14537426774
Log flushed up to   14537426774
Pages flushed up to 14496836384
Last checkpoint at  14496836384
0 pending log flushes, 0 pending chkp writes
166515 log i/o's done, 0.41 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 167772160
Dictionary memory allocated 1161768
Buffer pool size   8112
Free buffers       1
Database pages     10837
Old database pages 3980
Modified db pages  912
Percent of dirty pages(LRU & free pages): 8.414
Max dirty pages percent: 90.000
Pending reads 0
Pending writes: LRU 0, flush list 0
Pages made young 13727, not young 7534691
0.02 youngs/s, 0.00 non-youngs/s
Pages read 132825, created 1602, written 3521
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 10837, unzip_LRU len: 2358
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 read views open inside InnoDB
Process ID=0, Main thread ID=0, state: sleeping
Number of rows inserted 5462, updated 154607, deleted 799, read 8622602
0.00 inserts/s, 0.20 updates/s, 0.00 deletes/s, 5.87 reads/s
Number of system rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
obel1x commented 1 year ago

@TheWojtek only my thoughts: as long as no one changes the way filesizecalculation in the directory when changing files is done, this will always be a problem.

On the other hand, the first one is a lock of the index, which i don't see to be necessary. I do not know how they estimated the indices (edit: of table oc_filecache!) to create of that table, but i removed ALL given by NC, as they are looking terrible for me.

So if you wanna give it a try... Remove all indices but primary (edit: of table oc_filecache), and create those instead (PRIMARY mentioned here for completeness):

Edited to be more readable/thx to lemarakis (see beneath): PRIMARY KEY USING BTREE (fileid), KEY path_hash USING BTREE (path_hash), KEY fs_parent USING BTREE (parent)

only two others, only one column per index. After that, have a look if the deadlocks occur less and have a look in the slowlog (maybe do an optimize/repair to make changes become effective) If slowlog becomes a problem, you can have a look at the explain or tell me the query, so i will check index. For me in my usecase i am happy like that and i am ignoring those missing index- warnings in system check.

And maybe if we all agree on those indices, maybe the devs are thinking about why there are others - which in my case did not had a single use better that those new ones (checked with explains of all queries for some days), where doubling filesize, making all updates terrible slow and causing deadlocks also for me...

brunt82 commented 1 year ago

We also running in this problem, although we already cache with a redis server. But it does not happen very often. Anyhow currently we scan the user directory to update the file_cache-table so that the nextcloud client get the an actual file list from server.

lemarakis commented 1 year ago

We also facing same problem on 2 NC installations. Both with Redis, Apache, MariaDB 10.5.15, NC 25.0.3 It does happen often, when someone uploads alot of small in size files.

Until a solution is found, is there any way to hide the error from end-user?

obel1x commented 1 year ago

We also facing same problem on 2 NC installations. Both with Redis, Apache, MariaDB 10.5.15, NC 25.0.3 It does happen often, when someone uploads alot of small in size files.

Until a solution is found, is there any way to hide the error from end-user?

cloud you try my proposal of https://github.com/nextcloud/server/issues/6899#issuecomment-1377954159 and leave a thumb if it works? imo it would greatly reduce the risc to run into that error.

lemarakis commented 1 year ago

cloud you try my proposal of #6899 (comment) and leave a thumb if it works? imo it would greatly reduce the risc to run into that error.

Migrated from MariaDB to Postgres, which looks like better. Now, I have sporadic deadlock errors, but it's way better than before.

enoch85 commented 1 year ago

Sorry for noise, but Postgres FTW!

lemarakis commented 1 year ago

Same problem on fresh installation "by the book". I followed all the recommendations: NextCloud 25.0.3 Ubuntu 22.04 LTS (fully upgraded) MariaDB 10.6 (transaction isolation level=READ COMMITTED, binlog_format = ROW) PostgreSQL tested (it makes a little difference) Apache 2.4 with php-fpm PHP 8.1 Transactional file locking with Redis

I am testing with uploading a folder which contains 10000 small files (.ico). I am always getting the "Serialization failure: 1213 Deadlock" error.

3 different servers, with the same problem! What am I doing wrong????

lemarakis commented 1 year ago

cloud you try my proposal of #6899 (comment) and leave a thumb if it works? imo it would greatly reduce the risc to run into that error.

I checked this workaround. It seems that solve the locking problem, but the portal becomes a sluggish. I am experimenting with the indices, e.g. deleted the fs_storage_path_prefix from oc_filecache and it seems way better.