Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock found when trying to get lock; try restarting transaction in LDAP app #6187

Closed
snowball77 opened this issue Aug 19, 2017 · 16 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: ldap

Comments

@snowball77
Copy link

Steps to reproduce

  1. Install nextcloud, LDAP and a DAV app like calendar
  2. Run a huge amount of DAV operations like in a calendar synchronization

Expected behaviour

Tell us what should happen
Server should work fine. Best would be to not run into the issue at all, hotfix would be to do what the error says and retry the transaction (maybe while issueing a warning).

Actual behaviour

Tell us what happens instead
You get an "internal server error"
Server log explains the cause is a database locking issue "An exception occurred while executing 'UPDATE oc_preferences SET configvalue = ? WHERE (userid = ?) AND (appid = ?) AND (configkey = ?)' with params [...]. Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"

General server configuration

Operating system: Linux nextcloud-225186920-qsznp 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64

Web server: Apache/2.4.10 (Debian) (apache2handler)

Database: mysql 10.1.25

PHP version: 7.1.8

PHP-modules loaded
 - Core
 - date
 - libxml
 - openssl
 - pcre
 - sqlite3
 - zlib
 - ctype
 - curl
 - dom
 - fileinfo
 - filter
 - ftp
 - hash
 - iconv
 - json
 - mbstring
 - SPL
 - PDO
 - session
 - posix
 - Reflection
 - standard
 - SimpleXML
 - pdo_sqlite
 - Phar
 - tokenizer
 - xml
 - xmlreader
 - xmlwriter
 - mysqlnd
 - apache2handler
 - apcu
 - exif
 - gd
 - intl
 - ldap
 - mcrypt
 - memcached
 - mysqli
 - pcntl
 - pdo_mysql
 - pdo_pgsql
 - pgsql
 - redis
 - zip
 - Zend OPcache

Nextcloud configuration

Nextcloud version: 12.0.2 - 12.0.2.0

**Updated from an older Nextcloud/ownCloud or fresh install: Updated from 12.0

**Where did you install Nextcloud from: Offical docker image

**Are you using external storage, if yes which one: no

Are you using encryption: no

**Are you using an external user-backend, if yes which one: LDAP, using OpenLDAP - this is the root cause.

Signing status
[]
Enabled apps
 - activity: 2.5.2
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.3
 - comments: 1.2.0
 - contacts: 1.5.3
 - 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
 - issuetemplate: 0.2.2
 - 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
 - user_ldap: 1.2.1
 - workflowengine: 1.2.0
Disabled apps
 - admin_audit
 - encryption
 - files_external
 - user_external
Content of config/config.php
{
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "instanceid": "oco6psmk02yu",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "storage.rss.iste.uni-stuttgart.de",
        "nextcloud.default.svc.cluster.local"
    ],
    "datadirectory": "\/var\/www\/html\/data",
    "overwrite.cli.url": "https:\/\/storage.rss.iste.uni-stuttgart.de",
    "dbtype": "mysql",
    "version": "12.0.2.0",
    "dbname": "nextcloud",
    "dbhost": "pxc-cluster.default.svc.cluster.local",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
    "mail_smtpmode": "smtp",
    "mail_smtpauthtype": "LOGIN",
    "mail_domain": "rss.iste.uni-stuttgart.de",
    "mail_smtphost": "mailgw.informatik.uni-stuttgart.de",
    "mail_smtpport": "465",
    "mail_smtpdebug": true,
    "mail_smtpsecure": "ssl",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": true,
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "redis.default.svc.cluster.local",
        "port": 6379,
        "timeout": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "mail_from_address": "nextcloud-noreply",
    "theme": "",
    "loglevel": 2,
    "maintenance": false,
    "updater.secret": "***REMOVED SENSITIVE VALUE***"
}
LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0

**Operating system: latest MacOS

Logs

Web server error log
Insert your webserver log here
Nextcloud log (data/nextcloud.log)

{"reqId":"o0nv7P3dGBdRoHu5kexs","level":3,"time":"2017-08-19T15:51:18+00:00","remoteAddr":"10.244.4.134","user":"--","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/principals/users/ae7066da-f4fb-1036-8cad-9b286aacc383/","message":"Exception: {"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing 'UPDATE oc_preferences SET configvalue = ? WHERE (userid = ?) AND (appid = ?) AND (configkey = ?)' with params [1503157877, \"ae7066da-f4fb-1036-8cad-9b286aacc383\", \"user_ldap\", \"lastFeatureRefresh\"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":0,"Trace":"#0 \/var\/www\/html\/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\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(1015): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE oc_pref...', Array)\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/Connection.php(213): Doctrine\\\\DBAL\\\\Connection->executeUpdate('UPDATE oc_pref...', Array, Array)\n#3 \/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php(208): OC\\DB\\Connection->executeUpdate('UPDATE oc_pref...', Array, Array)\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(213): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#5 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AllConfig.php(232): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#6 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(372): OC\\\\AllConfig->setUserValue('ae7066da-f4fb-1...', 'user_ldap', 'lastFeatureRefr...', 1503157877)\\n#7 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User\\\/User.php(178): OCA\\\\User_LDAP\\\\User\\\\User->markRefreshTime()\\n#8 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/Access.php(835): OCA\\\\User_LDAP\\\\User\\\\User->processAttributes(Array)\\n#9 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/Access.php(807): OCA\\\\User_LDAP\\\\Access->batchApplyUserAttributes(Array)\\n#10 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/Access.php(780): OCA\\\\User_LDAP\\\\Access->fetchListOfUsers('(&(&(|(objectcl...', Array)\\n#11 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(136): OCA\\\\User_LDAP\\\\Access->fetchUsersByLoginName('snowball', Array)\\n#12 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User_LDAP.php(153): OCA\\\\User_LDAP\\\\User_LDAP->getLDAPUserByLoginName('snowball')\\n#13 [internal function]: OCA\\\\User_LDAP\\\\User_LDAP->checkPassword(*** sensitive parameters replaced ***)\\n#14 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(98): call_user_func_array(Array, Array)\\n#15 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/Proxy.php(148): OCA\\\\User_LDAP\\\\User_Proxy->callOnLastSeenOn('snowball', 'checkPassword', Array, false)\\n#16 \\\/var\\\/www\\\/html\\\/apps\\\/user_ldap\\\/lib\\\/User_Proxy.php(186): OCA\\\\User_LDAP\\\\Proxy->handleRequest('snowball', 'checkPassword', Array)\\n#17 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/User\\\/Manager.php(215): OCA\\\\User_LDAP\\\\User_Proxy->checkPassword(*** sensitive parameters replaced ***)\\n#18 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/User\\\/Manager.php(192): OC\\\\User\\\\Manager->checkPasswordNoLogging('snowball', 'SHAUsiCEaDyneRt')\\n#19 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/User\\\/Session.php(541): OC\\\\User\\\\Manager->checkPassword(*** sensitive parameters replaced ***)\\n#20 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/User\\\/Session.php(326): OC\\\\User\\\\Session->loginWithPassword(*** sensitive parameters replaced ***)\\n#21 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/User\\\/Session.php(400): OC\\\\User\\\\Session->login(*** sensitive parameters replaced ***)\\n#22 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Auth.php(129): OC\\\\User\\\\Session->logClientIn(*** sensitive parameters replaced ***)\\n#23 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Backend\\\/AbstractBasic.php(105): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth->validateUserPass(*** sensitive parameters replaced ***)\\n#24 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Auth.php(252): Sabre\\\\DAV\\\\Auth\\\\Backend\\\\AbstractBasic->check(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#25 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Auth.php(154): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth->auth(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#26 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php(201): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth->check(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#27 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php(150): Sabre\\\\DAV\\\\Auth\\\\Plugin->check(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#28 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#29 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#30 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#31 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#32 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Server.php(253): Sabre\\\\DAV\\\\Server->exec()\\n#33 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(33): OCA\\\\DAV\\\\Server->exec()\\n#34 \\\/var\\\/www\\\/html\\\/remote.php(162): require_once('\\\/var\\\/www\\\/html\\\/a...')\\n#35 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":116}","userAgent":"Mac OS X\/10.12.6 (16G29) AddressBook\/1756.20","version":"12.0.2.0"} {"reqId":"o0nv7P3dGBdRoHu5kexs","level":4,"time":"2017-08-19T15:51:18+00:00","remoteAddr":"10.244.4.134","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/principals\/users\/ae7066da-f4fb-1036-8cad-9b286aacc383\/","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Message\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException: An exception occurred while executing 'UPDATE oc_preferencesSETconfigvalue = ? WHERE (userid = ?) AND (appid = ?) AND (configkey` = ?)' with params [1503157877, \"ae7066da-f4fb-1036-8cad-9b286aacc383\", \"user_ldap\", \"lastFeatureRefresh\"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","Code":0,"Trace":"#0 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php(201): OCA\\DAV\\Connector\\Sabre\\Auth->check(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#1 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php(150): Sabre\\DAV\\Auth\\Plugin->check(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/var\/www\/html\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(466): Sabre\\Event\\EventEmitter->emit('beforeMethod', Array)\n#5 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/var\/www\/html\/apps\/dav\/lib\/Server.php(253): Sabre\\DAV\\Server->exec()\n#7 \/var\/www\/html\/apps\/dav\/appinfo\/v2\/remote.php(33): OCA\\DAV\\Server->exec()\n#8 \/var\/www\/html\/remote.php(162): require_once('\/var\/www\/html\/a...')\n#9 {main}","File":"\/var\/www\/html\/apps\/dav\/lib\/Connector\/Sabre\/Auth.php","Line":162}","userAgent":"Mac OS X/10.12.6 (16G29) AddressBook/1756.20","version":"12.0.2.0"}

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@snowball77
Copy link
Author

I digged into the code and already found the root cause of that issue. When executing the DAV request, nextcloud tries to verify username and password using the LDAP provider.

This provider queries LDAP to retrieve username and password. Once retrieved, the gathered attributes are memorized and the lastrefresh time is memorized in the database. When running many requests this is not performant and also triggers above database issue.

Overall, I think the whole behaviour should be checked. First, the lastRefreshed value might be better stored in a cache instead of the database. Second, the behavior does not respect the CacheLDAP timespan configuration value. This is set to, e.g., 600s, so I would expect a refresh the most every 10min as in the "update" method of User.php in the LDAP code. However, the code in "processAttributes" always refreshes, no matter whether 10min have passed. I wonder why the protective "if($this->needsRefresh())" is not used in the "processAttributes" method too.

@enoch85
Copy link
Member

enoch85 commented Aug 22, 2017

I'm seeing this without using LDAP.

EDIT; not this specific error message though. But deadlock.

@snowball77
Copy link
Author

Deadlocks might happen, most of the time when memory caching via PHP's memcache or redis is not configured correctly or under very high load. You could look up other issues on GitHub for hints how to resolve this.

The issue I am reporting here is more a programm bug as it accesses the database with high frequencies for no obvious reasons from the LDAP module.

@zalonic
Copy link

zalonic commented Sep 22, 2017

This is how I managed to resolve this issue for both my Local Auth server and my LDAP servers

Edit
lib/private/Files/Config/UserMountCache.php, find lines starting at #138

On all of the !== change them to != so it should look like this

if (
$newMount->getRootId() === $cachedMount->getRootId() &&
(
$newMount->getMountPoint() != $cachedMount->getMountPoint() ||
$newMount->getStorageId() != $cachedMount->getStorageId() ||
$newMount->getMountId() != $cachedMount->getMountId()
)
) {
$changed[] = $newMount;
}

Edit: Found this thread while I was trying to fix these issues so thought I'd post my findings.

@DMW007
Copy link

DMW007 commented Oct 31, 2017

Maybe this could help? #7005

@nickvergessen
Copy link
Member

Duplicate #3453

@snowball77
Copy link
Author

This is not a duplicate and should not be closed. I have the correct isolation level set and the issue I am describing still happens. As explained in my report, it is a specific issue in the LDAP provider which causes tons of unnecessary DB requests where only a request should happen every 10 minutes. Hence, this issue should be reopened as it is not resolved.

@nickvergessen
Copy link
Member

Well the message you posted above:

'UPDATE oc_preferences SET configvalue = ? WHERE (userid = ?) AND (appid = ?) AND (configkey = ?)' with params [...]. Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Is caused by a wrong transaction isolation level and unrelated to ldap,

anyway

@nickvergessen nickvergessen reopened this Oct 31, 2017
@snowball77
Copy link
Author

It is related to LDAP as the UPDATE you see there is caused by the LDAP plugin and it writes the same data cell every few microseconds - which IMHO is the root cause of the issue.

And let me cite from the Mysql docs: "For UPDATE or DELETE statements, InnoDB holds locks only for rows that it updates or deletes. Record locks for nonmatching rows are released after MySQL has evaluated the WHERE condition. This greatly reduces the probability of deadlocks, but they can still happen. " (cf. https://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-levels.html)

The issue here is that all these frequent UPDATEs lock exactly the same row (even they write the same attribute in that row). In sum, the raised the low likelyhood of deadlocks to a relevant one.

@snowball77
Copy link
Author

snowball77 commented Nov 2, 2017

I just cross-checked the issue: On the database I executed
SELECT @@GLOBAL.tx_isolation, @@tx_isolation
and got
READ-COMMITTED READ-COMMITTED
That should be right, shouldn't it?

But still I get

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing
'UPDATE `oc_preferences` SET `configvalue` = ? WHERE (`userid` = ?) AND (`appid` = ?)
AND (`configkey` = ?)' with params [..., ...., "user_ldap", "lastFeatureRefresh"]: 
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; 
try restarting transaction

@enoch85
Copy link
Member

enoch85 commented Nov 2, 2017

//edited the text --^

@snowball77
Copy link
Author

I tested the issue again with Nextcloud 13.0. It has dramatically decreased and is hard to trigger at all now due to the massive performance improvements in the LDAP connector. Once in a while it still happens, maybe when the server is under heavy load. But now it is at least on a very acceptable level.

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@MorrisJobke
Copy link
Member

Same for file locking: #6899

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jun 25, 2018
@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jul 26, 2018
@obel1x
Copy link

obel1x commented Nov 6, 2018

just saw this issue also related to Deadlock. i made a commit for solution needs testing at #6160.

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Nov 6, 2018
@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@skjnldsv
Copy link
Member

Fixed with #12411 I assume

@arch-user-france1
Copy link

arch-user-france1 commented May 9, 2022

I set up Nextcloud (23) on a Fedora server with Mariadb and if a user uploads a lot of files at once it happens again. The uploads fail with 500 server error and there's this:

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

PUT /remote.php/dav/files/france1/Dokumente/tor-browser_en-US/Browser/fonts/NotoSansYi-Regular.ttf
from 192.168.0.1 by france1 at 2022-05-04T11:50:37+00:00

I don't think that this is a configuration problem because I configured everything like I did on another server and there it worked (Nextcloud 22) except that I didn't use APCu

I have APCu, redis file locking and redis distributed cache as following:

  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 1.5,
  ),

Is the distributed redis cache the problem or is it a nextcloud problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: ldap
Projects
None yet
Development

No branches or pull requests