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

Re-fix transaction isolation level #22563

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Sep 3, 2020

Reverting #18227
It seems that this is somehow causing issues in various setups

Fix #22482
Fix nextcloud/spreed#4093

It seems that this is somehow causing issues in various setups

Ref server#22482
Ref spreed#4093

Signed-off-by: Joas Schilling <[email protected]>
@solracsf
Copy link
Member

solracsf commented Sep 3, 2020

@nickvergessen i've reverted those changes, and still having both problems of #22482 and nextcloud/spreed#4093

  • Patch applied
  • PHP Restarted
  • Redis Flushed
  • Browser Cache flushed

For #22482, uploaded 30 files > select them all > delete == Deadlocks on 4 out of 30 deletes.

Full log here
{
  "reqId":"aQYa928jJFW82kM9wiRN",
  "level":4,
  "time":"2020-09-03T16:18:50+02:00",
  "remoteAddr":"176.164.243.243",
  "user":"user",
  "app":"webdav",
  "method":"DELETE",
  "url":"/remote.php/dav/files/user/Test/bg-hero-solution.jpg",
  "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', '56c303da11d07c61688947bb3296276a'))' with params [1599142730, \"5f50fb4a0dde7\", 1]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction",
    "Code":0,
    "Trace":[
      {
        "file":"/var/www/nextcloud.com/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', '56c303da11d07c61688947bb3296276a'))' with params [1599142730, \"5f50fb4a0dde7\", 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.com/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', '56c303da11d07c61688947bb3296276a'))' with params [1599142730, \"5f50fb4a0dde7\", 1]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"
        ]
      },
      {
        "file":"/var/www/nextcloud.com/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', '56c303da11d07c61688947bb3296276a'))",
          {
            "1":1599142730,
            "2":"5f50fb4a0dde7",
            "3":1
          }
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/DB/Connection.php",
        "line":216,
        "function":"executeUpdate",
        "class":"Doctrine\\DBAL\\Connection",
        "type":"->",
        "args":[
          "UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '56c303da11d07c61688947bb3296276a'))",
          [
            1599142730,
            "5f50fb4a0dde7",
            1
          ],
          [
            1,
            2,
            1
          ]
        ]
      },
      {
        "file":"/var/www/nextcloud.com/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', '56c303da11d07c61688947bb3296276a'))",
          {
            "dcValue1":1599142730,
            "dcValue2":"5f50fb4a0dde7",
            "dcValue3":1
          },
          {
            "dcValue1":1,
            "dcValue2":2,
            "dcValue3":1
          }
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line":216,
        "function":"execute",
        "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Propagator.php",
        "line":101,
        "function":"execute",
        "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Updater.php",
        "line":166,
        "function":"propagateChange",
        "class":"OC\\Files\\Cache\\Propagator",
        "type":"->",
        "args":[
          "files/Test/bg-hero-solution.jpg",
          1599142730
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
        "line":329,
        "function":"remove",
        "class":"OC\\Files\\Cache\\Updater",
        "type":"->",
        "args":[
          "files/Test/bg-hero-solution.jpg"
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
        "line":1173,
        "function":"removeUpdate",
        "class":"OC\\Files\\View",
        "type":"->",
        "args":[
          {
            "mountPoint":"/user/",
            "cache":{
              "__class__":"OC\\Files\\Cache\\Cache"
            },
            "scanner":null,
            "watcher":null,
            "propagator":{
              "__class__":"OC\\Files\\Cache\\Propagator"
            },
            "updater":{
              "__class__":"OC\\Files\\Cache\\Updater"
            },
            "__class__":"OCA\\RansomwareProtection\\StorageWrapper"
          },
          "files/Test/bg-hero-solution.jpg"
        ]
      },
      {
        "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
        "line":718,
        "function":"basicOperation",
        "class":"OC\\Files\\View",
        "type":"->",
        "args":[
          "unlink",
          "/Test/bg-hero-solution.jpg",
          [
            "delete"
          ]
        ]
      },
      {
        "file":"/var/www/nextcloud.com/apps/dav/lib/Connector/Sabre/File.php",
        "line":455,
        "function":"unlink",
        "class":"OC\\Files\\View",
        "type":"->",
        "args":[
          "/Test/bg-hero-solution.jpg"
        ]
      },
      {
        "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line":183,
        "function":"delete",
        "class":"OCA\\DAV\\Connector\\Sabre\\File",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line":295,
        "function":"delete",
        "class":"Sabre\\DAV\\Tree",
        "type":"->",
        "args":[
          "files/user/Test/bg-hero-solution.jpg"
        ]
      },
      {
        "file":"/var/www/nextcloud.com/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.com/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.com/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.com/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":319,
        "function":"start",
        "class":"Sabre\\DAV\\Server",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/apps/dav/lib/Server.php",
        "line":320,
        "function":"exec",
        "class":"Sabre\\DAV\\Server",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php",
        "line":35,
        "function":"exec",
        "class":"OCA\\DAV\\Server",
        "type":"->",
        "args":[
          
        ]
      },
      {
        "file":"/var/www/nextcloud.com/remote.php",
        "line":167,
        "args":[
          "/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php"
        ],
        "function":"require_once"
      }
    ],
    "File":"/var/www/nextcloud.com/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.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",
          "line":1054,
          "function":"execute",
          "class":"Doctrine\\DBAL\\Driver\\PDOStatement",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/DB/Connection.php",
          "line":216,
          "function":"executeUpdate",
          "class":"Doctrine\\DBAL\\Connection",
          "type":"->",
          "args":[
            "UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '56c303da11d07c61688947bb3296276a'))",
            [
              1599142730,
              "5f50fb4a0dde7",
              1
            ],
            [
              1,
              2,
              1
            ]
          ]
        },
        {
          "file":"/var/www/nextcloud.com/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', '56c303da11d07c61688947bb3296276a'))",
            {
              "dcValue1":1599142730,
              "dcValue2":"5f50fb4a0dde7",
              "dcValue3":1
            },
            {
              "dcValue1":1,
              "dcValue2":2,
              "dcValue3":1
            }
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line":216,
          "function":"execute",
          "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Propagator.php",
          "line":101,
          "function":"execute",
          "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Updater.php",
          "line":166,
          "function":"propagateChange",
          "class":"OC\\Files\\Cache\\Propagator",
          "type":"->",
          "args":[
            "files/Test/bg-hero-solution.jpg",
            1599142730
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
          "line":329,
          "function":"remove",
          "class":"OC\\Files\\Cache\\Updater",
          "type":"->",
          "args":[
            "files/Test/bg-hero-solution.jpg"
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
          "line":1173,
          "function":"removeUpdate",
          "class":"OC\\Files\\View",
          "type":"->",
          "args":[
            {
              "mountPoint":"/user/",
              "cache":{
                "__class__":"OC\\Files\\Cache\\Cache"
              },
              "scanner":null,
              "watcher":null,
              "propagator":{
                "__class__":"OC\\Files\\Cache\\Propagator"
              },
              "updater":{
                "__class__":"OC\\Files\\Cache\\Updater"
              },
              "__class__":"OCA\\RansomwareProtection\\StorageWrapper"
            },
            "files/Test/bg-hero-solution.jpg"
          ]
        },
        {
          "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
          "line":718,
          "function":"basicOperation",
          "class":"OC\\Files\\View",
          "type":"->",
          "args":[
            "unlink",
            "/Test/bg-hero-solution.jpg",
            [
              "delete"
            ]
          ]
        },
        {
          "file":"/var/www/nextcloud.com/apps/dav/lib/Connector/Sabre/File.php",
          "line":455,
          "function":"unlink",
          "class":"OC\\Files\\View",
          "type":"->",
          "args":[
            "/Test/bg-hero-solution.jpg"
          ]
        },
        {
          "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/Tree.php",
          "line":183,
          "function":"delete",
          "class":"OCA\\DAV\\Connector\\Sabre\\File",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
          "line":295,
          "function":"delete",
          "class":"Sabre\\DAV\\Tree",
          "type":"->",
          "args":[
            "files/user/Test/bg-hero-solution.jpg"
          ]
        },
        {
          "file":"/var/www/nextcloud.com/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.com/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.com/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.com/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line":319,
          "function":"start",
          "class":"Sabre\\DAV\\Server",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/apps/dav/lib/Server.php",
          "line":320,
          "function":"exec",
          "class":"Sabre\\DAV\\Server",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php",
          "line":35,
          "function":"exec",
          "class":"OCA\\DAV\\Server",
          "type":"->",
          "args":[
            
          ]
        },
        {
          "file":"/var/www/nextcloud.com/remote.php",
          "line":167,
          "args":[
            "/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php"
          ],
          "function":"require_once"
        }
      ],
      "File":"/var/www/nextcloud.com/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.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php",
            "line":117,
            "function":"execute",
            "class":"PDOStatement",
            "type":"->",
            "args":[
              null
            ]
          },
          {
            "file":"/var/www/nextcloud.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",
            "line":1054,
            "function":"execute",
            "class":"Doctrine\\DBAL\\Driver\\PDOStatement",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/DB/Connection.php",
            "line":216,
            "function":"executeUpdate",
            "class":"Doctrine\\DBAL\\Connection",
            "type":"->",
            "args":[
              "UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, ?), `etag` = ? WHERE (`storage` = ?) AND (`path_hash` IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', '56c303da11d07c61688947bb3296276a'))",
              [
                1599142730,
                "5f50fb4a0dde7",
                1
              ],
              [
                1,
                2,
                1
              ]
            ]
          },
          {
            "file":"/var/www/nextcloud.com/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', '56c303da11d07c61688947bb3296276a'))",
              {
                "dcValue1":1599142730,
                "dcValue2":"5f50fb4a0dde7",
                "dcValue3":1
              },
              {
                "dcValue1":1,
                "dcValue2":2,
                "dcValue3":1
              }
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line":216,
            "function":"execute",
            "class":"Doctrine\\DBAL\\Query\\QueryBuilder",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Propagator.php",
            "line":101,
            "function":"execute",
            "class":"OC\\DB\\QueryBuilder\\QueryBuilder",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/Files/Cache/Updater.php",
            "line":166,
            "function":"propagateChange",
            "class":"OC\\Files\\Cache\\Propagator",
            "type":"->",
            "args":[
              "files/Test/bg-hero-solution.jpg",
              1599142730
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
            "line":329,
            "function":"remove",
            "class":"OC\\Files\\Cache\\Updater",
            "type":"->",
            "args":[
              "files/Test/bg-hero-solution.jpg"
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
            "line":1173,
            "function":"removeUpdate",
            "class":"OC\\Files\\View",
            "type":"->",
            "args":[
              {
                "mountPoint":"/user/",
                "cache":{
                  "__class__":"OC\\Files\\Cache\\Cache"
                },
                "scanner":null,
                "watcher":null,
                "propagator":{
                  "__class__":"OC\\Files\\Cache\\Propagator"
                },
                "updater":{
                  "__class__":"OC\\Files\\Cache\\Updater"
                },
                "__class__":"OCA\\RansomwareProtection\\StorageWrapper"
              },
              "files/Test/bg-hero-solution.jpg"
            ]
          },
          {
            "file":"/var/www/nextcloud.com/lib/private/Files/View.php",
            "line":718,
            "function":"basicOperation",
            "class":"OC\\Files\\View",
            "type":"->",
            "args":[
              "unlink",
              "/Test/bg-hero-solution.jpg",
              [
                "delete"
              ]
            ]
          },
          {
            "file":"/var/www/nextcloud.com/apps/dav/lib/Connector/Sabre/File.php",
            "line":455,
            "function":"unlink",
            "class":"OC\\Files\\View",
            "type":"->",
            "args":[
              "/Test/bg-hero-solution.jpg"
            ]
          },
          {
            "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/Tree.php",
            "line":183,
            "function":"delete",
            "class":"OCA\\DAV\\Connector\\Sabre\\File",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
            "line":295,
            "function":"delete",
            "class":"Sabre\\DAV\\Tree",
            "type":"->",
            "args":[
              "files/user/Test/bg-hero-solution.jpg"
            ]
          },
          {
            "file":"/var/www/nextcloud.com/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.com/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.com/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.com/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line":319,
            "function":"start",
            "class":"Sabre\\DAV\\Server",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/apps/dav/lib/Server.php",
            "line":320,
            "function":"exec",
            "class":"Sabre\\DAV\\Server",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php",
            "line":35,
            "function":"exec",
            "class":"OCA\\DAV\\Server",
            "type":"->",
            "args":[
              
            ]
          },
          {
            "file":"/var/www/nextcloud.com/remote.php",
            "line":167,
            "args":[
              "/var/www/nextcloud.com/apps/dav/appinfo/v2/remote.php"
            ],
            "function":"require_once"
          }
        ],
        "File":"/var/www/nextcloud.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php",
        "Line":117
      }
    },
    "CustomMessage":"--"
  },
  "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
  "version":"19.0.2.2"
}

For nextcloud/spreed#4093 same behavior as described in the ticket (browser errors, Room not found messages, etc.)

image

@faily-bot
Copy link

faily-bot bot commented Sep 3, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 32590: failure

mariadb10.4-php7.3

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There were 2 failures:

1) Test\SystemTag\SystemTagManagerTest::testGetAllTags with data set #1 (array(array('one', false, false), array('two', false, false)))
Failed asserting that false is true.

/drone/src/tests/lib/SystemTag/SystemTagManagerTest.php:122

2) OCA\Files_Sharing\Tests\SharedMountTest::testPermissionMovedGroupShare with data set #119 ('folder', 23, 5)
Failed asserting that false is true.

/drone/src/apps/files_sharing/tests/SharedMountTest.php:367

mysql5.6-php7.2

Show full log
There was 1 error:

1) OCA\DAV\Tests\unit\CalDAV\CalDavBackendTest::testCalendarSharing with data set #2 (true, true, true, true, array(array('principal:principals/groups/c...-group', false), array('principal:principals/groups/c...group2', true)))
TypeError: Argument 2 passed to OCA\DAV\Events\CalendarCreatedEvent::__construct() must be of the type array, null given, called in /drone/src/apps/dav/lib/CalDAV/CalDavBackend.php on line 790

/drone/src/apps/dav/lib/Events/CalendarCreatedEvent.php:51
/drone/src/apps/dav/lib/CalDAV/CalDavBackend.php:790
/drone/src/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php:153
/drone/src/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php:148

--

There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

@AndyXheli
Copy link

Should i try this fix ? or is this not working ?

@nickvergessen
Copy link
Member Author

Please try and report if it works on your setup

@AndyXheli
Copy link

working on it now. let you know

Copy link

@AndyXheli AndyXheli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope Same problem.

image

@simonspa
Copy link
Contributor

simonspa commented Sep 3, 2020

Interestingly for me it works (as discussed in the Talk room). I haven't applied the full patch but just add the one line back:
https://github.com/nextcloud/server/pull/18227/files#diff-a297b981d90788f23b37333106691efeL155
(and the required use statement to include that class)

@solracsf
Copy link
Member

solracsf commented Sep 3, 2020

Another "not work" feedback here :#22482 (comment)

@AndyXheli
Copy link

AndyXheli commented Sep 3, 2020

@nickvergessen I also revert back the changes

@simonspa
Copy link
Contributor

simonspa commented Sep 3, 2020

I did some more tests and it seems to work for some cases. I only get one of the three different stack traces I had seen before, and after a second sync everything is fine - which was not the case before. But it definitely does not solve the issue completely unfortunately.

@AndyXheli
Copy link

AndyXheli commented Sep 3, 2020

@nickvergessen Looks like this issue happens when you select multiple files and delete them but if you delete files one by one there's no issue from what i can see.

@cy2201
Copy link

cy2201 commented Sep 3, 2020

@nickvergessen Looks like this issue happens when you select multiple files and delete them but if you delete files one by one there's no issue from what i can see.

That's true.

@AndyXheli

This comment has been minimized.

@rullzer rullzer mentioned this pull request Sep 6, 2020
13 tasks
@AndyXheli
Copy link

@nickvergessen any updates on this?

@nickvergessen
Copy link
Member Author

nickvergessen commented Sep 9, 2020

Can you please put the following code as test.php on your server open it with https://cloud.example.com/test.php and post the result here?:

<?php
use Doctrine\DBAL\TransactionIsolationLevel;
require_once __DIR__ . '/lib/versioncheck.php';
require_once __DIR__ . '/lib/base.php';

$db = \OC::$server->getDatabaseConnection();
$c = \OC::$server->getConfig();
var_dump($db->inTransaction());
try {
	if ($db->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQL80Platform) {
		var_dump($db->executeQuery('SELECT @@GLOBAL.transaction_isolation, @@transaction_isolation')->fetchAll());
		var_dump($db->setTransactionIsolation(TransactionIsolationLevel::REPEATABLE_READ));
		var_dump($db->executeQuery('SELECT @@GLOBAL.transaction_isolation, @@transaction_isolation')->fetchAll());
		var_dump($db->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED));
		var_dump($db->executeQuery('SELECT @@GLOBAL.transaction_isolation, @@transaction_isolation')->fetchAll());
	} else {
		var_dump($db->executeQuery('SELECT @@GLOBAL.tx_isolation, @@tx_isolation')->fetchAll());
		var_dump($db->setTransactionIsolation(TransactionIsolationLevel::REPEATABLE_READ));
		var_dump($db->executeQuery('SELECT @@GLOBAL.tx_isolation, @@tx_isolation')->fetchAll());
		var_dump($db->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED));
		var_dump($db->executeQuery('SELECT @@GLOBAL.tx_isolation, @@tx_isolation')->fetchAll());
	}

	var_dump($db->executeQuery("SHOW GRANTS FOR '" . $c->getSystemValueString('dbuser') . "'@'" . $c->getSystemValueString('dbhost') . "'")->fetchAll());
	var_dump($db->executeQuery("SHOW CREATE USER '" . $c->getSystemValueString('dbuser') . "'@'" . $c->getSystemValueString('dbhost') . "'")->fetchAll());
} catch (\Throwable $e) {
	var_dump($e);
}

@simonspa
Copy link
Contributor

simonspa commented Sep 9, 2020

Here you go:

# sudo -u www-data php test.php
bool(false)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(15) "REPEATABLE-READ"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
array(2) {
  [0]=>
  array(1) {
    ["Grants for nextcloud_user@localhost"]=>
    string(117) "GRANT USAGE ON *.* TO `nextcloud_user`@`localhost` IDENTIFIED BY PASSWORD 'XXX'"
  }
  [1]=>
  array(1) {
    ["Grants for nextcloud_user@localhost"]=>
    string(69) "GRANT ALL PRIVILEGES ON `nextcloud`.* TO `nextcloud_user`@`localhost`"
  }
}
array(1) {
  [0]=>
  array(1) {
    ["CREATE USER for nextcloud_user@localhost"]=>
    string(107) "CREATE USER `nextcloud_user`@`localhost` IDENTIFIED BY PASSWORD 'XXX'"
  }
}

@AndyXheli
Copy link

AndyXheli commented Sep 9, 2020

@nickvergessen Here you go:

sudo -u www-data php test.php

bool(false)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.transaction_isolation"]=>
    string(15) "REPEATABLE-READ"
    ["@@transaction_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.transaction_isolation"]=>
    string(15) "REPEATABLE-READ"
    ["@@transaction_isolation"]=>
    string(15) "REPEATABLE-READ"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.transaction_isolation"]=>
    string(15) "REPEATABLE-READ"
    ["@@transaction_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
array(2) {
  [0]=>
  array(1) {
    ["Grants for ncadmin@localhost"]=>
    string(43) "GRANT USAGE ON *.* TO `ncadmin`@`localhost`"
  }
  [1]=>
  array(1) {
    ["Grants for ncadmin@localhost"]=>
    string(69) "GRANT ALL PRIVILEGES ON `nextcloud`.* TO `ncadmin`@`localhost`"
  }
}
array(1) {
  [0]=>
  array(1) {
    ["CREATE USER for ncadmin@localhost"]=>
    string(227) "CREATE USER 'ncadmin'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS <secret> REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT"
  }
}

@nickvergessen
Copy link
Member Author

nickvergessen commented Sep 10, 2020

Is anyone willing to give me access to a failing server? No one of our engineering team can reproduce this locally or on their server, so it's really hard to debug.

Use the SSH key from my github profile: https://github.com/nickvergessen.keys
And drop an email to <my github name>@nextcloud.com

@AndyXheli
Copy link

@nickvergessen me to send you a meeting invite ? And you can remote in ?

@AndyXheli
Copy link

AndyXheli commented Sep 10, 2020

Is anyone willing to give me access to a failing server? No one of our engineering team can reproduce this locally or on their server, so it's really hard to debug.

Use the SSH key from my github profile: https://github.com/nickvergessen.keys
And drop an email to <my github name>@nextcloud.com

Just sent you an email. When you're ready to join im on the meeting.

@nickvergessen
Copy link
Member Author

Thanks for the help @axheli see email :)

@cy2201
Copy link

cy2201 commented Sep 10, 2020

bool(false) array(1) { [0]=> array(2) { ["@@GLOBAL.tx_isolation"]=> string(15) "REPEATABLE-READ" ["@@tx_isolation"]=> string(14) "READ-COMMITTED" } } int(0) array(1) { [0]=> array(2) { ["@@GLOBAL.tx_isolation"]=> string(15) "REPEATABLE-READ" ["@@tx_isolation"]=> string(15) "REPEATABLE-READ" } } int(0) array(1) { [0]=> array(2) { ["@@GLOBAL.tx_isolation"]=> string(15) "REPEATABLE-READ" ["@@tx_isolation"]=> string(14) "READ-COMMITTED" } } array(2) { [0]=> array(1) { ["Grants for nextcloud@localhost"]=> string(112) "GRANT USAGE ON *.* TO `nextcloud`@`localhost` IDENTIFIED BY PASSWORD '*XXX'" } [1]=> array(1) { ["Grants for nextcloud@localhost"]=> string(238) "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `nextcloud`.* TO `nextcloud`@`localhost`" } } array(1) { [0]=> array(1) { ["CREATE USER for nextcloud@localhost"]=> string(102) "CREATE USER `nextcloud`@`localhost` IDENTIFIED BY PASSWORD '*XXX'" } } 

@nickvergessen: Kannst per Remote Desktop in mein Server schauen.

@rullzer rullzer mentioned this pull request Sep 11, 2020
5 tasks
@rullzer rullzer modified the milestones: Nextcloud 20, Nextcloud 21 Sep 17, 2020
@rullzer
Copy link
Member

rullzer commented Sep 17, 2020

Since this isn't solving it it seems I'm moving this to 21.

@AndyXheli
Copy link

Since this isn't solving it it seems I'm moving this to 21.

So what do we do with all these sync errors and not able to delete files. At this point the system is not stable.

@kroko
Copy link

kroko commented Sep 17, 2020

php test.php > test.dump

bool(false)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(15) "REPEATABLE-READ"
  }
}
int(0)
array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(14) "READ-COMMITTED"
    ["@@tx_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}
object(Doctrine\DBAL\Exception\ConnectionException)#438 (8) {
  ["driverException":"Doctrine\DBAL\Exception\DriverException":private]=>
  object(Doctrine\DBAL\Driver\PDOException)#437 (10) {
    ["errorCode":"Doctrine\DBAL\Driver\PDOException":private]=>
    int(1044)
    ["sqlState":"Doctrine\DBAL\Driver\PDOException":private]=>
    string(5) "42000"
    ["message":protected]=>
    string(122) "SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
    ["string":"Exception":private]=>
    string(0) ""
    ["code":protected]=>
    string(5) "42000"
    ["file":protected]=>
    string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
    ["line":protected]=>
    int(90)
    ["trace":"Exception":private]=>
    array(3) {
      [0]=>
      array(5) {
        ["file"]=>
        string(97) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"
        ["line"]=>
        int(908)
        ["function"]=>
        string(5) "query"
        ["class"]=>
        string(34) "Doctrine\DBAL\Driver\PDOConnection"
        ["type"]=>
        string(2) "->"
      }
      [1]=>
      array(5) {
        ["file"]=>
        string(71) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/lib/private/DB/Connection.php"
        ["line"]=>
        int(194)
        ["function"]=>
        string(12) "executeQuery"
        ["class"]=>
        string(24) "Doctrine\DBAL\Connection"
        ["type"]=>
        string(2) "->"
      }
      [2]=>
      array(5) {
        ["file"]=>
        string(50) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/test.php"
        ["line"]=>
        int(24)
        ["function"]=>
        string(12) "executeQuery"
        ["class"]=>
        string(16) "OC\DB\Connection"
        ["type"]=>
        string(2) "->"
      }
    }
    ["previous":"Exception":private]=>
    object(PDOException)#436 (8) {
      ["message":protected]=>
      string(122) "SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
      ["string":"Exception":private]=>
      string(0) ""
      ["code":protected]=>
      string(5) "42000"
      ["file":protected]=>
      string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
      ["line":protected]=>
      int(88)
      ["trace":"Exception":private]=>
      array(4) {
        [0]=>
        array(5) {
          ["file"]=>
          string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
          ["line"]=>
          int(88)
          ["function"]=>
          string(5) "query"
          ["class"]=>
          string(3) "PDO"
          ["type"]=>
          string(2) "->"
        }
        [1]=>
        array(5) {
          ["file"]=>
          string(97) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"
          ["line"]=>
          int(908)
          ["function"]=>
          string(5) "query"
          ["class"]=>
          string(34) "Doctrine\DBAL\Driver\PDOConnection"
          ["type"]=>
          string(2) "->"
        }
        [2]=>
        array(5) {
          ["file"]=>
          string(71) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/lib/private/DB/Connection.php"
          ["line"]=>
          int(194)
          ["function"]=>
          string(12) "executeQuery"
          ["class"]=>
          string(24) "Doctrine\DBAL\Connection"
          ["type"]=>
          string(2) "->"
        }
        [3]=>
        array(5) {
          ["file"]=>
          string(50) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/test.php"
          ["line"]=>
          int(24)
          ["function"]=>
          string(12) "executeQuery"
          ["class"]=>
          string(16) "OC\DB\Connection"
          ["type"]=>
          string(2) "->"
        }
      }
      ["previous":"Exception":private]=>
      NULL
      ["errorInfo"]=>
      array(3) {
        [0]=>
        string(5) "42000"
        [1]=>
        int(1044)
        [2]=>
        string(66) "Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
      }
    }
    ["errorInfo"]=>
    array(3) {
      [0]=>
      string(5) "42000"
      [1]=>
      int(1044)
      [2]=>
      string(66) "Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
    }
  }
  ["message":protected]=>
  string(228) "An exception occurred while executing 'SHOW GRANTS FOR 'nextclouddbusername'@'localhost:/run/mysqld/mysqld.sock'':

SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
  ["string":"Exception":private]=>
  string(0) ""
  ["code":protected]=>
  int(0)
  ["file":protected]=>
  string(113) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php"
  ["line":protected]=>
  int(93)
  ["trace":"Exception":private]=>
  array(5) {
    [0]=>
    array(5) {
      ["file"]=>
      string(100) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php"
      ["line"]=>
      int(169)
      ["function"]=>
      string(16) "convertException"
      ["class"]=>
      string(40) "Doctrine\DBAL\Driver\AbstractMySQLDriver"
      ["type"]=>
      string(2) "->"
    }
    [1]=>
    array(5) {
      ["file"]=>
      string(100) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php"
      ["line"]=>
      int(145)
      ["function"]=>
      string(13) "wrapException"
      ["class"]=>
      string(27) "Doctrine\DBAL\DBALException"
      ["type"]=>
      string(2) "::"
    }
    [2]=>
    array(5) {
      ["file"]=>
      string(97) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"
      ["line"]=>
      int(911)
      ["function"]=>
      string(26) "driverExceptionDuringQuery"
      ["class"]=>
      string(27) "Doctrine\DBAL\DBALException"
      ["type"]=>
      string(2) "::"
    }
    [3]=>
    array(5) {
      ["file"]=>
      string(71) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/lib/private/DB/Connection.php"
      ["line"]=>
      int(194)
      ["function"]=>
      string(12) "executeQuery"
      ["class"]=>
      string(24) "Doctrine\DBAL\Connection"
      ["type"]=>
      string(2) "->"
    }
    [4]=>
    array(5) {
      ["file"]=>
      string(50) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/test.php"
      ["line"]=>
      int(24)
      ["function"]=>
      string(12) "executeQuery"
      ["class"]=>
      string(16) "OC\DB\Connection"
      ["type"]=>
      string(2) "->"
    }
  }
  ["previous":"Exception":private]=>
  object(Doctrine\DBAL\Driver\PDOException)#437 (10) {
    ["errorCode":"Doctrine\DBAL\Driver\PDOException":private]=>
    int(1044)
    ["sqlState":"Doctrine\DBAL\Driver\PDOException":private]=>
    string(5) "42000"
    ["message":protected]=>
    string(122) "SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
    ["string":"Exception":private]=>
    string(0) ""
    ["code":protected]=>
    string(5) "42000"
    ["file":protected]=>
    string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
    ["line":protected]=>
    int(90)
    ["trace":"Exception":private]=>
    array(3) {
      [0]=>
      array(5) {
        ["file"]=>
        string(97) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"
        ["line"]=>
        int(908)
        ["function"]=>
        string(5) "query"
        ["class"]=>
        string(34) "Doctrine\DBAL\Driver\PDOConnection"
        ["type"]=>
        string(2) "->"
      }
      [1]=>
      array(5) {
        ["file"]=>
        string(71) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/lib/private/DB/Connection.php"
        ["line"]=>
        int(194)
        ["function"]=>
        string(12) "executeQuery"
        ["class"]=>
        string(24) "Doctrine\DBAL\Connection"
        ["type"]=>
        string(2) "->"
      }
      [2]=>
      array(5) {
        ["file"]=>
        string(50) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/test.php"
        ["line"]=>
        int(24)
        ["function"]=>
        string(12) "executeQuery"
        ["class"]=>
        string(16) "OC\DB\Connection"
        ["type"]=>
        string(2) "->"
      }
    }
    ["previous":"Exception":private]=>
    object(PDOException)#436 (8) {
      ["message":protected]=>
      string(122) "SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
      ["string":"Exception":private]=>
      string(0) ""
      ["code":protected]=>
      string(5) "42000"
      ["file":protected]=>
      string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
      ["line":protected]=>
      int(88)
      ["trace":"Exception":private]=>
      array(4) {
        [0]=>
        array(5) {
          ["file"]=>
          string(107) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php"
          ["line"]=>
          int(88)
          ["function"]=>
          string(5) "query"
          ["class"]=>
          string(3) "PDO"
          ["type"]=>
          string(2) "->"
        }
        [1]=>
        array(5) {
          ["file"]=>
          string(97) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php"
          ["line"]=>
          int(908)
          ["function"]=>
          string(5) "query"
          ["class"]=>
          string(34) "Doctrine\DBAL\Driver\PDOConnection"
          ["type"]=>
          string(2) "->"
        }
        [2]=>
        array(5) {
          ["file"]=>
          string(71) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/lib/private/DB/Connection.php"
          ["line"]=>
          int(194)
          ["function"]=>
          string(12) "executeQuery"
          ["class"]=>
          string(24) "Doctrine\DBAL\Connection"
          ["type"]=>
          string(2) "->"
        }
        [3]=>
        array(5) {
          ["file"]=>
          string(50) "/home/nixuserrunningcloud/nixuserrunningcloud-www/live/public/test.php"
          ["line"]=>
          int(24)
          ["function"]=>
          string(12) "executeQuery"
          ["class"]=>
          string(16) "OC\DB\Connection"
          ["type"]=>
          string(2) "->"
        }
      }
      ["previous":"Exception":private]=>
      NULL
      ["errorInfo"]=>
      array(3) {
        [0]=>
        string(5) "42000"
        [1]=>
        int(1044)
        [2]=>
        string(66) "Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
      }
    }
    ["errorInfo"]=>
    array(3) {
      [0]=>
      string(5) "42000"
      [1]=>
      int(1044)
      [2]=>
      string(66) "Access denied for user 'nextclouddbusername'@'localhost' to database 'mysql'"
    }
  }
}

MariaDB config, concated

# ################################################################
# ################################################################
#
# WARP MariaDB configuration
# Basic configuration
# Read by /etc/mysql/my.cnf
# /etc/mysql/warp-conf.d/warp-100-mariadb-securing.cnf
# sudo systemctl restart mariadb

# ================================
# SECURITY

# ----------------
# Networking
# As a reference, do not disable TCP/IP networking, but listen only on localhost
# If skip-networking is enabled then connections via SSH has to use unix socket instead of host:port

# [mysqld]
# skip-networking

# ----------------
# Networking
# listen only on localhost

[mysqld]
bind-address                = 127.0.0.1

# ----------------
# Disable LOAD DATA LOCAL statement
# https://dev.mysql.com/doc/refman/8.0/en/load-data-local-security.html
# https://dev.mysql.com/doc/refman/8.0/en/load-data.html

[mysqld]
local-infile                = 0

# ----------------
# Disable SHOW DATABASES statement by default
# https://dev.mysql.com/doc/refman/8.0/en/show-databases.html
# User has to have explicit privilege

[mysqld]
skip-show-database

# ----------------
# Port changes
# At this point do not use security through obscurity, keep 3306

# [client]
# port                      = <some-non-3306>
# [mysqld]
# port                      = <some-non-3306>

# ################################################################
# ################################################################
#
# WARP MariaDB configuration
# Nextcloud minimum configuration
# Read by /etc/mysql/my.cnf
# /etc/mysql/warp-conf.d/warp-200-mariadb-encoding.cnf
# sudo systemctl restart mariadb

# https://mariadb.com/kb/en/setting-character-sets-and-collations/

# ================================
# True UTF-8

# All client programs
[client]
default-character-set       = utf8mb4

# Specific client programs
[client-mariadb]
default-character-set       = utf8mb4

# Specific client programs
[mysql]
default-character-set       = utf8mb4

# Specific client programs
[mysqldump]
default-character-set       = utf8mb4

# Server - MySQL and MariaDB
[mysqld]
character-set-server        = utf8mb4
init-connect                = 'SET NAMES utf8mb4'
collation-server            = utf8mb4_unicode_ci

# Server - MariaDB 
[mariadb]
character-set-server        = utf8mb4
init-connect                = 'SET NAMES utf8mb4'
collation-server            = utf8mb4_unicode_ci

# ################################################################
# ################################################################
#
# WARP MariaDB configuration
# Nextcloud minimum configuration
# Read by /etc/mysql/my.cnf
# /etc/mysql/warp-conf.d/warp-01-mariadb-nextcloud-minimum.cnf
# sudo systemctl restart mariadb

# https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html
# https://mariadb.com/kb/en/innodb-file-format/
# In MariaDB 10.2.2 and later, the default file format is Barracuda and Antelope is deprecated.

# ================================
# TUNING - InnoDB and Barracuda

[mysqld]
default_storage_engine      = InnoDB        # Default on MariaDB 10.3, MySQL 8.0+
innodb_file_format          = Barracuda     # Default on MariaDB 10.3, MySQL 8.0+
innodb_file_per_table       = 1
innodb_large_prefix         = 1             # Default on MariaDB 10.3, MySQL 8.0+

# ================================
# Others

[mysqld]
transaction_isolation       = READ-COMMITTED
binlog_format               = ROW

# ################################################################
# ################################################################
#
# WARP MariaDB configuration
# Tuning, debugging
# Read by /etc/mysql/my.cnf
# /etc/mysql/warp-conf.d/warp-01-mariadb-tuning.cnf
# sudo systemctl restart mariadb

# https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html

# ================================
# TUNING - InnoDB
# https://mariadb.com/kb/en/innodb/
# https://dev.mysql.com/doc/refman/8.0/en/innodb-storage-engine.html

# ----------------
# InnoDB - buffer pool 
# On a dedicated HW can be even up to 60-70% of RAM
# 1G is recommended for Nextcloud

[server]

innodb_buffer_pool_size     = 1G # orig 256M, depends on system RAM

[server]

innodb_buffer_pool_instances    = 1

# ----------------
# InnoDB - InnoDB I/O Capacity
# https://dev.mysql.com/doc/refman/5.7/en/innodb-configuring-io-capacity.html
# https://www.percona.com/blog/2019/12/18/give-love-to-your-ssds-reduce-innodb_io_capacity_max/
# 4000 is recommended for Nextcloud

[server]

innodb_io_capacity              = 4000 # org 400

# ----------------
# InnoDB - Other

[server]

innodb_flush_log_at_trx_commit  = 2
innodb_log_buffer_size          = 32M # org 8M
innodb_max_dirty_pages_pct      = 90

# ================================
# TUNING - Query Cache Configuration

[mysqld]

query_cache_type            = 1 # orig 1
query_cache_limit           = 2M # orig 131072 (128 KiB)
query_cache_min_res_unit    = 4K # orig 4096 (4 KiB)
query_cache_size            = 64M # orig 67108864 (64 MiB)

# ================================
# TUNING - Fine Tuning

# ----------------
# Max connections

[mysqld]
max_connections             = 300 # orig 100

# ----------------
# Idle Connections
# mysqladmin processlist -u root -p | grep “Sleep”

[mysqld]
wait_timeout                = 600 # orig 600

# ----------------
# Idle Connections

[mysqld]
max_allowed_packet          = 16M # orig 16M

# ----------------
# Thread cache size

[mysqld]
thread_cache_size           = 128 # orig 128
# thread_pool_size should be decided on runtime, usually same as core count

# ----------------
# tmp_table_size and max_heap_table_size
# 64M for both values for every GB of RAM on the server

[mysqld]
tmp_table_size              = 128M # orig 33554432 (32 MiB)
max_heap_table_size         = 128M # orig 33554432 (32 MiB)

# ================================
# TUNING - Other

# ----------------
# Skip reverse DNS lookup of clients
# If skip-name-resolve is enabled then connections via SSH has to use unix socket instead of host:port

[mysqld]
#skip-name-resolve

# ================================
# Logging and Replication

# ----------------
# Enable Slow query Logs

[mysqld]
slow-query-log              = 1
slow-query-log-file         = /var/log/mysql/mariadb-slow.log
long_query_time             = 1 # orig 10
#log_slow_rate_limit        = 1000
log_slow_verbosity          = query_plan

# ----------------
# Logs

# [mysqld]
# log = /var/log/mysql/mariadb-full.log

# ================================
# Others

@AndyXheli
Copy link

Hi everyone any updates on this?

@nickvergessen
Copy link
Member Author

Should be fixed via #23109 now

@nickvergessen nickvergessen deleted the bugfix/22482/fix-setting-transaction-isolation-level branch October 5, 2020 13:05
@AndyXheli
Copy link

@nickvergessen should this ticket be reopened since its not fixed? or are we referencing #23109 going forwarded

@nickvergessen
Copy link
Member Author

This is a Pull request, not an issue and as per your comment it doesn't fix it, so it doesn't need to be reopened.

@AndyXheli
Copy link

Understood, So then is pull request #23109 the one that should fix issue #22482. Just wanted to clarify so I know what pull request to monitor.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock found when trying to get lock DeadlockException executing UPDATE oc_filecache
8 participants