server
server copied to clipboard
DeadlockException executing UPDATE `oc_filecache`
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Report
Getting the following error when deleting files. I even setup a new Nextcloud 19.0.2 server and still same issue. Seems to be related with photo files more then docs.
Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing
'UPDATE `oc_filecache` SET `size` = ? WHERE (`fileid` = ?) AND ((`size` <> ?) OR (`size` IS NULL))'
with params [237591435, 213130, 237591435]:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
I've already ran
sudo -u www-data php occ files:scan-app-data
sudo -u www-data php occ files:scan --all
sudo -u www-data php occ files:cleanup
Already checked the oc_filecache table; and no issues there based on the output of mysql.
There are several issues like this like https://github.com/nextcloud/server/issues/15047, but it clears seems a new problem introduced in 19.0.2 as it affects all our instances with different setups after upgrading from 19.0.1.
We can reproduce it but uploading many files (30) to a folder then select them all and delete. Some of them will produce a Deadlock.
Filelocking is enabled on Redis. I'm using MariaBD 10.4.
Detailed output
{
"reqId": "1IyGszyr4rk3uCA4FIoF",
"level": 4,
"time": "2020-08-27T16:06:11+02:00",
"remoteAddr": "176.177.105.226",
"user": "nextcloud",
"app": "webdav",
"method": "DELETE",
"url": "/remote.php/dav/files/nextcloud/Photos/hvkjbhvbkljmknbm.png",
"message": {
"Exception": "Doctrine\\DBAL\\Exception\\DeadlockException",
"Message": "An exception occurred while executing 'UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))' with params [1598537171, \"5f47bdd345199\", 1]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php",
"line": 169,
"function": "convertException",
"class": "Doctrine\\DBAL\\Driver\\AbstractMySQLDriver",
"type": "->",
"args": [
"An exception occurred while executing 'UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))' with params [1598537171, \"5f47bdd345199\", 1]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction",
{
"errorInfo": [
"40001",
1213,
"Deadlock found when trying to get lock; try restarting transaction"
],
"__class__": "Doctrine\\DBAL\\Driver\\PDOException"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php",
"line": 145,
"function": "wrapException",
"class": "Doctrine\\DBAL\\DBALException",
"type": "::",
"args": [
{
"__class__": "Doctrine\\DBAL\\Driver\\PDOMySql\\Driver"
},
{
"errorInfo": [
"40001",
1213,
"Deadlock found when trying to get lock; try restarting transaction"
],
"__class__": "Doctrine\\DBAL\\Driver\\PDOException"
},
"An exception occurred while executing 'UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))' with params [1598537171, \"5f47bdd345199\", 1]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",
"line": 1063,
"function": "driverExceptionDuringQuery",
"class": "Doctrine\\DBAL\\DBALException",
"type": "::",
"args": [
{
"__class__": "Doctrine\\DBAL\\Driver\\PDOMySql\\Driver"
},
{
"errorInfo": [
"40001",
1213,
"Deadlock found when trying to get lock; try restarting transaction"
],
"__class__": "Doctrine\\DBAL\\Driver\\PDOException"
},
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
{
"1": 1598537171,
"2": "5f47bdd345199",
"3": 1
}
]
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 214,
"function": "executeUpdate",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
[
1598537171,
"5f47bdd345199",
1
],
[
1,
2,
1
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php",
"line": 203,
"function": "executeUpdate",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, :dcValue1), `etag` = :dcValue2 WHERE (`storage` = :dcValue3) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
{
"dcValue1": 1598537171,
"dcValue2": "5f47bdd345199",
"dcValue3": 1
},
{
"dcValue1": 1,
"dcValue2": 2,
"dcValue3": 1
}
]
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 216,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Propagator.php",
"line": 101,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Updater.php",
"line": 166,
"function": "propagateChange",
"class": "OC\\Files\\Cache\\Propagator",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png",
1598537171
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 329,
"function": "remove",
"class": "OC\\Files\\Cache\\Updater",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 1173,
"function": "removeUpdate",
"class": "OC\\Files\\View",
"type": "->",
"args": [
{
"cache": {
"__class__": "OC\\Files\\Cache\\Cache"
},
"scanner": null,
"watcher": null,
"propagator": {
"__class__": "OC\\Files\\Cache\\Propagator"
},
"updater": {
"__class__": "OC\\Files\\Cache\\Updater"
},
"__class__": "OCA\\Files_Trashbin\\Storage"
},
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 718,
"function": "basicOperation",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"unlink",
"/Photos/hvkjbhvbkljmknbm.png",
[
"delete"
]
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
"line": 455,
"function": "unlink",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
"line": 183,
"function": "delete",
"class": "OCA\\DAV\\Connector\\Sabre\\File",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 295,
"function": "delete",
"class": "Sabre\\DAV\\Tree",
"type": "->",
"args": [
"files/nextcloud/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpDelete",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 474,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:DELETE",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 251,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 319,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Server.php",
"line": 320,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 35,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"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/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php",
"Line": 34,
"Previous": {
"Exception": "Doctrine\\DBAL\\Driver\\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/lib/Doctrine/DBAL/Connection.php",
"line": 1054,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDOStatement",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 214,
"function": "executeUpdate",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
[
1598537171,
"5f47bdd345199",
1
],
[
1,
2,
1
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php",
"line": 203,
"function": "executeUpdate",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, :dcValue1), `etag` = :dcValue2 WHERE (`storage` = :dcValue3) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
{
"dcValue1": 1598537171,
"dcValue2": "5f47bdd345199",
"dcValue3": 1
},
{
"dcValue1": 1,
"dcValue2": 2,
"dcValue3": 1
}
]
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 216,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Propagator.php",
"line": 101,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Updater.php",
"line": 166,
"function": "propagateChange",
"class": "OC\\Files\\Cache\\Propagator",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png",
1598537171
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 329,
"function": "remove",
"class": "OC\\Files\\Cache\\Updater",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 1173,
"function": "removeUpdate",
"class": "OC\\Files\\View",
"type": "->",
"args": [
{
"cache": {
"__class__": "OC\\Files\\Cache\\Cache"
},
"scanner": null,
"watcher": null,
"propagator": {
"__class__": "OC\\Files\\Cache\\Propagator"
},
"updater": {
"__class__": "OC\\Files\\Cache\\Updater"
},
"__class__": "OCA\\Files_Trashbin\\Storage"
},
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 718,
"function": "basicOperation",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"unlink",
"/Photos/hvkjbhvbkljmknbm.png",
[
"delete"
]
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
"line": 455,
"function": "unlink",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
"line": 183,
"function": "delete",
"class": "OCA\\DAV\\Connector\\Sabre\\File",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 295,
"function": "delete",
"class": "Sabre\\DAV\\Tree",
"type": "->",
"args": [
"files/nextcloud/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpDelete",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 474,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:DELETE",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 251,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 319,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Server.php",
"line": 320,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 35,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"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/lib/Doctrine/DBAL/Driver/PDOStatement.php",
"Line": 119,
"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/lib/Doctrine/DBAL/Driver/PDOStatement.php",
"line": 117,
"function": "execute",
"class": "PDOStatement",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",
"line": 1054,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDOStatement",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 214,
"function": "executeUpdate",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
[
1598537171,
"5f47bdd345199",
1
],
[
1,
2,
1
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php",
"line": 203,
"function": "executeUpdate",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, :dcValue1), `etag` = :dcValue2 WHERE (`storage` = :dcValue3) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd01bb67e7b71dd49fd06bad922f521c9'))",
{
"dcValue1": 1598537171,
"dcValue2": "5f47bdd345199",
"dcValue3": 1
},
{
"dcValue1": 1,
"dcValue2": 2,
"dcValue3": 1
}
]
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 216,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Propagator.php",
"line": 101,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/lib/private/Files/Cache/Updater.php",
"line": 166,
"function": "propagateChange",
"class": "OC\\Files\\Cache\\Propagator",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png",
1598537171
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 329,
"function": "remove",
"class": "OC\\Files\\Cache\\Updater",
"type": "->",
"args": [
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 1173,
"function": "removeUpdate",
"class": "OC\\Files\\View",
"type": "->",
"args": [
{
"cache": {
"__class__": "OC\\Files\\Cache\\Cache"
},
"scanner": null,
"watcher": null,
"propagator": {
"__class__": "OC\\Files\\Cache\\Propagator"
},
"updater": {
"__class__": "OC\\Files\\Cache\\Updater"
},
"__class__": "OCA\\Files_Trashbin\\Storage"
},
"files/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 718,
"function": "basicOperation",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"unlink",
"/Photos/hvkjbhvbkljmknbm.png",
[
"delete"
]
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
"line": 455,
"function": "unlink",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
"line": 183,
"function": "delete",
"class": "OCA\\DAV\\Connector\\Sabre\\File",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 295,
"function": "delete",
"class": "Sabre\\DAV\\Tree",
"type": "->",
"args": [
"files/nextcloud/Photos/hvkjbhvbkljmknbm.png"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpDelete",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 474,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:DELETE",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 251,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 319,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Server.php",
"line": 320,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 35,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"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/lib/Doctrine/DBAL/Driver/PDOStatement.php",
"Line": 117
}
},
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0",
"version": "19.0.2.2"
}
Cc @nextcloud/server-triage
@acsfer Yup I only get it then I select alot of file within a folder to delete. Idk why this is happening but this should be looked at and fixed!
I got worried that my database got corrupt and I build a new server and still the same issue so definitely not a my server instance your anyone else that's having the issue out there.
cc @canadaduane @jcfischer
Same to me - since upgrade to 19.0.2
Came here to say that I have the same problem with ALL instances of NC right after upgrading to 19.0.2. Even performed a fresh installation of 19.0.2 - the problem is still here.
After some debugging, I found it only happens if I try to delete multiple files at once. If I delete the same files one after one, everything works perfectly. But select them all - and deadlock message is here...
Another update: the issue exists even after adding "'filelocking.enabled' => false" line to config file.
Yeah the message is not from the file locking feature, but from a database lock
Cc @icewind1991 @rullzer anything changed in filesystem recently with regards to that?
I get various forms of DeadlockException almost every time I sync files (last time I wrote a comment about it: https://github.com/nextcloud/server/issues/10473#issuecomment-650783226). I guess it's finally happening with MySQL as well.
There are quite a few issues related to these errors (https://github.com/nextcloud/server/issues/11136, https://github.com/nextcloud/server/issues/15047, https://github.com/nextcloud/server/issues/21537). These errors are not dangerous by themselves. The error means that 2 database transactions could not be executed at the same time and one of them got cancelled ( see https://en.wikipedia.org/wiki/Deadlock ). Retrying that transaction should be enough, but Nextcloud does not seem to handle these errors at all.
DeadlockExceptions can only happen when multiple requests are made to the Nextcloud server at the same time, so testing requires adding/removing multiple files, not just one. It should also only happen on queries that read/modify multiple rows.
My most recent DeadlockException:
Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing 'UPDATE "oc_filecache" SET "size" = GREATEST(?, "size" + ?) WHERE ("storage" = ?) AND ("path_hash" IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'f55b8b9ffac161f2bbd566bd5a4c8075', 'd642cac0349fb48bcc52d75171a3ce7c')) AND ("size" > '-1')' with params [-1, 3691355, 2]: SQLSTATE[40P01]: Deadlock detected: 7 ERROR: deadlock detected DETAIL: Process 2427 waits for ShareLock on transaction 44023088; blocked by process 2425. Process 2425 waits for ShareLock on transaction 44023091; blocked by process 2427. HINT: See server log for query details. CONTEXT: while rechecking updated tuple (325,6) in relation "oc_filecache"
@APTX Thank you for the detailed info, hopefully the dev team can figure something out.
Not sure this helps, but these are the queries (along with the back traces) which seem to trigger this for me:
UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?)
[webdav] Fatal: Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing 'UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '5ef60ea8991f2576a90bb23baa5e4399', '48056cb550ab7052ab094f43fbb60058', 'fa7f16366733c3a3ea5b328fd5b52fa3', '6f979bb2b50146cf44f3065c1d67f59d', 'c11f4c49a04a182bbc89e93f52d09f32', '8b89822309373a5aae36013d86a47681'))' with params [1598854372, "5f4c94e4f3cb9", 9]:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at <<closure>>
0. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... n", Doctrine\DBAL\Dr ... ]})
1. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... n")
2. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "UPDATE `oc_file ... )", {1: 1598854372,2: "5f4c94e4f3cb9",3: 9})
3. /var/www/nextcloud/lib/private/DB/Connection.php line 214
Doctrine\DBAL\Connection->executeUpdate("UPDATE `oc_file ... )", [1598854372,"5f4c94e4f3cb9",9], [1,2,1])
4. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 203
OC\DB\Connection->executeUpdate("UPDATE `oc_file ... )", {dcValue1: 15988 ... 9}, {dcValue1: 1,dcValue2: 2,dcValue3: 1})
5. /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 216
Doctrine\DBAL\Query\QueryBuilder->execute()
6. /var/www/nextcloud/lib/private/Files/Cache/Propagator.php line 101
OC\DB\QueryBuilder\QueryBuilder->execute()
7. /var/www/nextcloud/lib/private/Files/Cache/HomePropagator.php line 49
OC\Files\Cache\Propagator->propagateChange("files/ ... 6", 1598854372, 0)
8. /var/www/nextcloud/lib/private/Files/Cache/Updater.php line 166
OC\Files\Cache\HomePropagator->propagateChange("files ... 6", 1598854372)
9. /var/www/nextcloud/lib/private/Files/View.php line 329
OC\Files\Cache\Updater->remove("files/<file> ... 6")
10. /var/www/nextcloud/lib/private/Files/View.php line 1173
OC\Files\View->removeUpdate(OCA\Files_Trashb ... }}, "files/<file> ... 6")
11. /var/www/nextcloud/lib/private/Files/View.php line 718
OC\Files\View->basicOperation("unlink", "/<file> ... 6", ["delete"])
12. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 455
OC\Files\View->unlink("/<file> ... 6")
13. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 183
OCA\DAV\Connector\Sabre\File->delete()
14. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 295
Sabre\DAV\Tree->delete("files/<file> ... 6")
15. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
16. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 474
Sabre\DAV\Server->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
17. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 251
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
18. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 319
Sabre\DAV\Server->start()
19. /var/www/nextcloud/apps/dav/lib/Server.php line 320
Sabre\DAV\Server->exec()
20. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
21. /var/www/nextcloud/remote.php line 167
require_once("/var/www/nextcl ... p")
DELETE /remote.php/dav/files/...
from <ip> by <user> at 2020-08-31T08:12:53+02:00
UPDATE `oc_filecache` SET `size` = ?
[webdav] Fatal: Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing 'UPDATE `oc_filecache` SET `size` = ? WHERE (`fileid` = ?) AND ((`size` <> ?) OR (`size` IS NULL))' with params [93564, 2024096, 93564]:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at <<closure>>
0. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... n", Doctrine\DBAL\Dr ... ]})
1. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... n")
2. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "UPDATE `oc_file ... )", {1: 93564,2: "** ... 4})
3. /var/www/nextcloud/lib/private/DB/Connection.php line 214
Doctrine\DBAL\Connection->executeUpdate("UPDATE `oc_file ... )", [93564,"*** sens ... 4], [2,1,2])
4. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 203
OC\DB\Connection->executeUpdate("UPDATE `oc_file ... )", {dcValue1: "*** ... 4}, {dcValue1: 1,dcValue2: 2,dcValue3: 2})
5. /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 216
Doctrine\DBAL\Query\QueryBuilder->execute()
6. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 363
OC\DB\QueryBuilder\QueryBuilder->execute()
7. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 898
OC\Files\Cache\Cache->update("*** sensitive parameters replaced ***")
8. /var/www/nextcloud/lib/private/Files/Cache/HomeCache.php line 43
OC\Files\Cache\Cache->calculateFolderSize("files/<file> ... t", OC\Files\Cache\CacheEntry {})
9. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 830
OC\Files\Cache\HomeCache->calculateFolderSize("files/<file> ... t", null)
10. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 842
OC\Files\Cache\Cache->correctFolderSize("files/<file> ... t")
11. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 842
OC\Files\Cache\Cache->correctFolderSize("files/<file> ... t")
12. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 842
OC\Files\Cache\Cache->correctFolderSize("files/<file> ... s")
13. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 842
OC\Files\Cache\Cache->correctFolderSize("files/<file> ... 5")
14. /var/www/nextcloud/lib/private/Files/Cache/Updater.php line 217
OC\Files\Cache\Cache->correctFolderSize("files/<file> ... 4")
15. /var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php line 289
OC\Files\Cache\Updater->renameFromStorage(OCA\Files_Trashb ... }}, "files/<file> ... 4", "files_trashbin/ ... 2")
16. /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 108
OCA\Files_Trashbin\Trashbin::move2trash("<file> ... 4")
17. /var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php line 103
OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash(OCA\Files_Trashb ... }}, "files/<file> ... 4")
18. /var/www/nextcloud/apps/files_trashbin/lib/Storage.php line 192
OCA\Files_Trashbin\Trash\TrashManager->moveToTrash(OCA\Files_Trashb ... }}, "files/<file> ... 4")
19. /var/www/nextcloud/apps/files_trashbin/lib/Storage.php line 99
OCA\Files_Trashbin\Storage->doDelete("files/<file> ... 4", "unlink")
20. /var/www/nextcloud/lib/private/Files/View.php line 1161
OCA\Files_Trashbin\Storage->unlink("files/<file> ... 4")
21. /var/www/nextcloud/lib/private/Files/View.php line 718
OC\Files\View->basicOperation("unlink", "/<file> ... 4", ["delete"])
22. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 455
OC\Files\View->unlink("/<file> ... 4")
23. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 183
OCA\DAV\Connector\Sabre\File->delete()
24. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 295
Sabre\DAV\Tree->delete("files/ ... 4")
25. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
26. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 474
Sabre\DAV\Server->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
27. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 251
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
28. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 319
Sabre\DAV\Server->start()
29. /var/www/nextcloud/apps/dav/lib/Server.php line 320
Sabre\DAV\Server->exec()
30. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
31. /var/www/nextcloud/remote.php line 167
require_once("/var/www/nextcl ... p")
DELETE /remote.php/dav/files/...
from <ip> by <user> at 2020-08-31T08:12:52+02:00
UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?))
[webdav] Fatal: Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing 'UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?)) WHERE (`storage` = ?) AND (`path` LIKE ?)' with params [9, "files_trashbin\/files\/08.d1598854370", 59, "files_trashbin\/files\/08.d1598854370", 59, 9, "files\/<file>\/%"]:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at <<closure>>
0. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... n", Doctrine\DBAL\Dr ... ]})
1. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... n")
2. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "UPDATE `oc_file ... )", {1: 9,2: "files_ ... "})
3. /var/www/nextcloud/lib/private/DB/Connection.php line 214
Doctrine\DBAL\Connection->executeUpdate("UPDATE `oc_file ... )", [9,"files_trashb ... "], [1,2,1,2,1,1,2])
4. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 203
OC\DB\Connection->executeUpdate("UPDATE `oc_file ... )", {dcValue1: "file ... "}, {dcValue1: 2,dcV ... 2})
5. /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 216
Doctrine\DBAL\Query\QueryBuilder->execute()
6. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 647
OC\DB\QueryBuilder\QueryBuilder->execute()
7. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 585
OC\Files\Cache\Cache->moveFromCache(OC\Files\Cache\HomeCache {}, "files/<file> ... 8", "files_trashbin/files/08.d1598854370")
8. /var/www/nextcloud/lib/private/Files/Cache/Updater.php line 199
OC\Files\Cache\Cache->move("files/<file> ... 8", "files_trashbin/files/08.d1598854370")
9. /var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php line 289
OC\Files\Cache\Updater->renameFromStorage(OCA\Files_Trashb ... }}, "files/<file> ... 8", "files_trashbin/files/08.d1598854370")
10. /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 108
OCA\Files_Trashbin\Trashbin::move2trash("<file> ... 8")
11. /var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php line 103
OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash(OCA\Files_Trashb ... }}, "files/<file> ... 8")
12. /var/www/nextcloud/apps/files_trashbin/lib/Storage.php line 192
OCA\Files_Trashbin\Trash\TrashManager->moveToTrash(OCA\Files_Trashb ... }}, "files/<file> ... 8")
13. /var/www/nextcloud/apps/files_trashbin/lib/Storage.php line 118
OCA\Files_Trashbin\Storage->doDelete("files/<file> ... 8", "rmdir")
14. /var/www/nextcloud/lib/private/Files/View.php line 1161
OCA\Files_Trashbin\Storage->rmdir("files/<file> ... 8")
15. /var/www/nextcloud/lib/private/Files/View.php line 350
OC\Files\View->basicOperation("rmdir", "/<file> ... 8", ["delete"])
16. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 308
OC\Files\View->rmdir("/<file> ... 8")
17. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 183
OCA\DAV\Connector\Sabre\Directory->delete()
18. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 295
Sabre\DAV\Tree->delete("files/<file> ... 8")
19. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
20. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 474
Sabre\DAV\Server->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
21. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 251
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
22. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 319
Sabre\DAV\Server->start()
23. /var/www/nextcloud/apps/dav/lib/Server.php line 320
Sabre\DAV\Server->exec()
24. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
25. /var/www/nextcloud/remote.php line 167
require_once("/var/www/nextcl ... p")
DELETE /remote.php/dav/files/<file>
from <ip> by <user> at 2020-08-31T08:12:50+02:00
+1 on tthe issue. I seem to be unable to delete folders that contain subfolders since the update.
Doing so will make the linux desktop sync-client throw errors at me for hours at which point I just killed the sync client for now...
Doing a scan --all now with the hope it will fix things.
Yesterday i tried deleting files from my IOS app and this was my error log files took forever to delete and i had to hot delete 2 or 3 times
https://github.com/nextcloud/server/pull/22563 may fix this. Feedback welcome.
Just applied patch 4a3f6a7616fee24c0877e2d63ca2bdd9789e9cf1 to nextcloud 19.0.2 and restarted apache2.
Trying to delete multiple files at once still gives the same error messages.
I have same problems. I can't delete multiple files. When I files one by one and wait some seconds between these steps it seems to work. But my logs are full with similar error messages like yours.
MariaDB [(none)]> SELECT @@GLOBAL.tx_isolation, @@tx_isolation;
+-----------------------+----------------+
| @@GLOBAL.tx_isolation | @@tx_isolation |
+-----------------------+----------------+
| READ-COMMITTED | READ-COMMITTED |
+-----------------------+----------------+
Output of MariaDB SHOW ENGINE INNODB STATUS\G
:
------------------------
LATEST DETECTED DEADLOCK
------------------------
2020-09-04 12:45:28 0x7fce70f63700
*** (1) TRANSACTION:
TRANSACTION 91989232, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 4 row lock(s), undo log entries 1
MySQL thread id 257055, OS thread handle 140524754528000, query id 6196914 10.1.0.4 nextcloud Updating
UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, 1599216328), `etag` = '5f521ac8effdb' WHERE (`storage` = 1) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '56c303da11d07c61688947bb3296276a'))
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 13131 page no 245 n bits 136 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 91989232 lock_mode X locks rec but not gap waiting
Record lock, heap no 46 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
0: len 8; hex 800000000000ba29; asc );;
1: len 6; hex 0000057ba4e3; asc { ;;
2: len 7; hex 27000001a209a0; asc ' ;;
3: len 8; hex 8000000000000001; asc ;;
4: len 10; hex 66696c65732f54657374; asc files/Test;;
5: len 30; hex 353663333033646131316430376336313638383934376262333239363237; asc 56c303da11d07c61688947bb329627; (total 32 bytes);
6: len 8; hex 8000000000000002; asc ;;
7: len 4; hex 54657374; asc Test;;
8: len 8; hex 8000000000000002; asc ;;
9: len 8; hex 8000000000000001; asc ;;
10: len 8; hex 80000000004f9b3e; asc O >;;
11: len 8; hex 800000005f521ac8; asc _R ;;
12: len 8; hex 800000005f521ac8; asc _R ;;
13: len 4; hex 80000000; asc ;;
14: len 8; hex 8000000000000000; asc ;;
15: len 13; hex 35663532316163386565346637; asc 5f521ac8ee4f7;;
16: len 4; hex 8000001f; asc ;;
17: SQL NULL;
*** (2) TRANSACTION:
TRANSACTION 91989219, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
4 lock struct(s), heap size 1128, 3 row lock(s), undo log entries 2
MySQL thread id 257058, OS thread handle 140524635174656, query id 6196920 10.1.0.5 nextcloud Updating
UPDATE `oc_filecache` SET `size` = '5217086' WHERE (`fileid` = 2) AND ((`size` <> '5217086') OR (`size` IS NULL))
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 13131 page no 245 n bits 136 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 91989219 lock_mode X locks rec but not gap
Record lock, heap no 46 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
0: len 8; hex 800000000000ba29; asc );;
1: len 6; hex 0000057ba4e3; asc { ;;
2: len 7; hex 27000001a209a0; asc ' ;;
3: len 8; hex 8000000000000001; asc ;;
4: len 10; hex 66696c65732f54657374; asc files/Test;;
5: len 30; hex 353663333033646131316430376336313638383934376262333239363237; asc 56c303da11d07c61688947bb329627; (total 32 bytes);
6: len 8; hex 8000000000000002; asc ;;
7: len 4; hex 54657374; asc Test;;
8: len 8; hex 8000000000000002; asc ;;
9: len 8; hex 8000000000000001; asc ;;
10: len 8; hex 80000000004f9b3e; asc O >;;
11: len 8; hex 800000005f521ac8; asc _R ;;
12: len 8; hex 800000005f521ac8; asc _R ;;
13: len 4; hex 80000000; asc ;;
14: len 8; hex 8000000000000000; asc ;;
15: len 13; hex 35663532316163386565346637; asc 5f521ac8ee4f7;;
16: len 4; hex 8000001f; asc ;;
17: SQL NULL;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 13131 page no 10 n bits 160 index PRIMARY of table `nextcloud`.`oc_filecache` trx id 91989219 lock_mode X locks rec but not gap waiting
Record lock, heap no 3 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
0: len 8; hex 8000000000000002; asc ;;
1: len 6; hex 0000057ba4f0; asc { ;;
2: len 7; hex 2f000001a10794; asc / ;;
3: len 8; hex 8000000000000001; asc ;;
4: len 5; hex 66696c6573; asc files;;
5: len 30; hex 343562393633333937616134306434613030363365306438356534666537; asc 45b963397aa40d4a0063e0d85e4fe7; (total 32 bytes);
6: len 8; hex 8000000000000001; asc ;;
7: len 5; hex 66696c6573; asc files;;
8: len 8; hex 8000000000000002; asc ;;
9: len 8; hex 8000000000000001; asc ;;
10: len 8; hex 80000000004ad20b; asc J ;;
11: len 8; hex 800000005f521ac8; asc _R ;;
12: len 8; hex 800000005f521217; asc _R ;;
13: len 4; hex 80000000; asc ;;
14: len 8; hex 8000000000000000; asc ;;
15: len 13; hex 35663532316163386566666462; asc 5f521ac8effdb;;
16: len 4; hex 8000001f; asc ;;
17: SQL NULL;
*** WE ROLL BACK TRANSACTION (1)
now im having sync issues i deleted these files but somehow still in the system. this bug is very bad
LATEST DETECTED DEADLOCK
2020-09-04 14:17:00 0x7f9f480c3700
*** (1) TRANSACTION:
TRANSACTION 26302302, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1136, 3 row lock(s), undo log entries 1
MySQL thread id 15512, OS thread handle 140343225358080, query id 1739477 localhost axadmin updating
UPDATE oc_filecache
SET size
= '10056210310' WHERE (fileid
= 709463) AND ((size
<> '10056210310') OR (size
IS NULL))
*** (1) HOLDS THE LOCK(S):
RECORD LOCKS space id 32 page no 2770 n bits 312 index fs_storage_path_hash of table nextcloud
.oc_filecache
trx id 26302302 lock_mode X locks re c but not gap
Record lock, heap no 3 PHYSICAL RECORD: n_fields 3; compact format; info bits 32
0: len 8; hex 8000000000000003; asc ;;
1: len 30; hex 623065323032383265646231316237383333363063666661326432396335; asc b0e20282edb11b783360cffa2d29c5; (total 32 bytes);
2: len 8; hex 80000000000ae59c; asc ;;
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 32 page no 5561 n bits 104 index PRIMARY of table nextcloud
.oc_filecache
trx id 26302302 lock_mode X locks rec but not gap waiting
Record lock, heap no 26 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
0: len 8; hex 80000000000ad357; asc W;;
1: len 6; hex 00000191575c; asc W;;
2: len 7; hex 02000000f618a3; asc ;;
3: len 8; hex 8000000000000003; asc ;;
4: len 12; hex 66696c65732f50686f746f73; asc files/Photos;;
5: len 30; hex 643031626236376537623731646434396664303662616439323266353231; asc d01bb67e7b71dd49fd06bad922f521; (total 32 bytes);
6: len 8; hex 80000000000000f9; asc ;;
7: len 6; hex 50686f746f73; asc Photos;;
8: len 8; hex 8000000000000002; asc ;;
9: len 8; hex 8000000000000001; asc ;;
10: len 8; hex 8000000257872eff; asc W . ;;
11: len 8; hex 800000005f5292ac; asc _R ;;
12: len 8; hex 800000005f5292aa; asc _R ;;
13: len 4; hex 80000000; asc ;;
14: len 8; hex 8000000000000000; asc ;;
15: len 13; hex 35663532393261633637356365; asc 5f5292ac675ce;;
16: len 4; hex 8000001f; asc ;;
17: len 0; hex ; asc ;;
*** (2) TRANSACTION:
TRANSACTION 26302300, ACTIVE 0 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 477 lock struct(s), heap size 57552, 16 row lock(s), undo log entries 12
MySQL thread id 15511, OS thread handle 140343775688448, query id 1739476 localhost axadmin Searching rows for update
UPDATE oc_filecache
SET storage
= 3, path_hash
= MD5(CONCAT('files_encryption/keys/files_trashbin/files/20-09-04 11-32-06 2306.jpg.d1599247020', SUBS TR(path
, 62))), path
= CONCAT('files_encryption/keys/files_trashbin/files/20-09-04 11-32-06 2306.jpg.d1599247020', SUBSTR(path
, 62)) WHERE (storage
= 3) AND (path
LIKE 'files\_encryption/keys/files/Photos/20-09-04 11-32-06 2306.jpg/%')
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 32 page no 5561 n bits 104 index PRIMARY of table nextcloud
.oc_filecache
trx id 26302300 lock_mode X locks rec but not gap
Record lock, heap no 26 PHYSICAL RECORD: n_fields 18; compact format; info bits 0
0: len 8; hex 80000000000ad357; asc W;;
1: len 6; hex 00000191575c; asc W;;
2: len 7; hex 02000000f618a3; asc ;;
3: len 8; hex 8000000000000003; asc ;;
4: len 12; hex 66696c65732f50686f746f73; asc files/Photos;;
5: len 30; hex 643031626236376537623731646434396664303662616439323266353231; asc d01bb67e7b71dd49fd06bad922f521; (total 32 bytes);
6: len 8; hex 80000000000000f9; asc ;;
7: len 6; hex 50686f746f73; asc Photos;;
8: len 8; hex 8000000000000002; asc ;;
9: len 8; hex 8000000000000001; asc ;;
10: len 8; hex 8000000257872eff; asc W . ;;
11: len 8; hex 800000005f5292ac; asc _R ;;
12: len 8; hex 800000005f5292aa; asc _R ;;
13: len 4; hex 80000000; asc ;;
14: len 8; hex 8000000000000000; asc ;;
15: len 13; hex 35663532393261633637356365; asc 5f5292ac675ce;;
16: len 4; hex 8000001f; asc ;;
17: len 0; hex ; asc ;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 32 page no 2770 n bits 312 index fs_storage_path_hash of table nextcloud
.oc_filecache
trx id 26302300 lock_mode X locks re c but not gap waiting
Record lock, heap no 3 PHYSICAL RECORD: n_fields 3; compact format; info bits 32
0: len 8; hex 8000000000000003; asc ;;
1: len 30; hex 623065323032383265646231316237383333363063666661326432396335; asc b0e20282edb11b783360cffa2d29c5; (total 32 bytes);
2: len 8; hex 80000000000ae59c; asc ;;
*** WE ROLL BACK TRANSACTION (1)
@nickvergessen any updates on this?
Same problems here, on 19.0.2 and mysql. This bug also occurs when a Windows sync client reads files from a server (w/o any write operations). This is a production system, so I cannot install a patch, but I'm happy to provide more (debugging) information if required.
Not fixed in 19.0.3. Affected versions are:
- 18.0.8
- 18.0.9
- 19.0.2
- 19.0.3
I can confirm not fixed on 19.0.3
@acsfer Did you only update to 18.0.8 or did it work on 18.0.7 ?
Well i have one instance on 18 and I don't think the problem was present at 18.0.7.
I can only confirm that it wasn't at 19.0.1.
You can see that the linked issue #22563 remains open, so no fix has yet made it into a release. Once that issue is closed, then you might see it in a release.
Do you all have encryption enabled or had encryption enabled at some point?
Yes encryption is enabled on mine.
I did have, several years ago, probably before the migration to Nextcloud - and there might be some remnants left in the file system (I spotted owncloud_private_key
and public-keys
directories) but currently I have no encryption enabled.
@nickvergessen encryption is completely disabled on my side on all instances and all of them have the issue.
I have encryption enabled (default encryption module). But it looks the bug affects non-encrypted instances as well.