Skip to content

PHP Fatal error: Uncaught PDOException: Deadlock detected #15047

@mfr00t

Description

@mfr00t

Server configuration

OS: Debian 9
Nextcloud Version: 15(0.7)
PHP Version: 7.2 (fpm)
Database: Postgresql 9.6
Webserver: Apache
Single-User system

Steps to reproduce

not known

fpm and postgres logs getting spammed with these entries:

Logs

fpm_nextcloud.log:

PHP Fatal error:  Uncaught PDOException: SQLSTATE[40P01]: Deadlock detected: 7 ERROR:  deadlock detected
DETAIL:  Process 14896 waits for ShareLock on transaction 1930337; blocked by process 14897.
Process 14897 waits for ShareLock on transaction 1930336; blocked by process 14896.
HINT:  See server log for query details.
CONTEXT:  while rechecking updated tuple (12,138) in relation "oc_file_locks" in /opt/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
Stack trace:
#0 /opt/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL)
#1 /opt/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /opt/nextcloud/lib/private/DB/Connection.php(216): Doctrine\DBAL\Connection->executeUpdate('UPDATE "oc_file...', Array, Array)
#3 /opt/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(208): OC\DB\Connection->executeUpdate('UPDATE "oc_file...', Array, Array)
#4 /opt/next in /opt/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php on line 92

postgresql-9.6-main.log:

2019-04-11 05:15:18 GMT ERROR:  duplicate key value violates unique constraint "lock_key_index"
2019-04-11 05:15:18 GMT DETAIL:  Key (key)=(files/7d79c31537be24aadcda7fa480987df4) already exists.
2019-04-11 05:15:18 GMT STATEMENT:  INSERT INTO "oc_file_locks" ("key", "lock", "ttl") VALUES($1, $2, $3)
2019-04-11 05:15:18 GMT ERROR:  duplicate key value violates unique constraint "lock_key_index"
2019-04-11 05:15:18 GMT DETAIL:  Key (key)=(files/abfe242a994b591cb4dee19585031873) already exists.
2019-04-11 05:15:18 GMT STATEMENT:  INSERT INTO "oc_file_locks" ("key", "lock", "ttl") VALUES($1, $2, $3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbugneeds info

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions