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

Database is locked #4812

Closed
GretaD opened this issue Mar 23, 2021 · 7 comments
Closed

Database is locked #4812

GretaD opened this issue Mar 23, 2021 · 7 comments

Comments

@GretaD
Copy link
Contributor

GretaD commented Mar 23, 2021

{
  "status": "error",
  "message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked",
  "data": {
    "debug": true,
    "type": "OC\\DB\\Exceptions\\DbalException",
    "message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked",
    "code": 5,
    "trace": [
      {
        "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 320,
        "function": "wrap",
        "class": "OC\\DB\\Exceptions\\DbalException"
      },
      {
        "file": "/home/user/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
        "line": 211,
        "function": "executeUpdate",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
      },
      {
        "file": "/home/user/nextcloud/apps/mail/lib/Db/MailboxMapper.php",
        "line": 228,
        "function": "update",
        "class": "OCP\\AppFramework\\Db\\QBMapper"
      },
      {
        "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 246,
        "function": "unlockFromVanishedSync",
        "class": "OCA\\Mail\\Db\\MailboxMapper"
      },
      {
        "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
        "line": 121,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
      },
      {
        "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
        "line": 161,
        "function": "syncMailbox",
        "class": "OCA\\Mail\\Service\\Sync\\SyncService"
      },
      {
        "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 218,
        "function": "sync",
        "class": "OCA\\Mail\\Controller\\MailboxesController"
      },
      {
        "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 127,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher"
      },
      {
        "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher"
      },
      {
        "file": "/home/user/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App"
      },
      {
        "file": "/home/user/nextcloud/lib/base.php",
        "line": 998,
        "function": "match",
        "class": "OC\\Route\\Router"
      },
      {
        "file": "/home/user/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC"
      }
    ],
    "previous": {
      "type": "Doctrine\\DBAL\\Exception\\LockWaitTimeoutException",
      "message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked",
      "code": 5,
      "trace": [
        {
          "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1728,
          "function": "convert",
          "class": "Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter"
        },
        {
          "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1667,
          "function": "handleDriverException",
          "class": "Doctrine\\DBAL\\Connection"
        },
        {
          "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
          "line": 1146,
          "function": "convertExceptionDuringQuery",
          "class": "Doctrine\\DBAL\\Connection"
        },
        {
          "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
          "line": 260,
          "function": "executeStatement",
          "class": "Doctrine\\DBAL\\Connection"
        },
        {
          "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
          "line": 213,
          "function": "executeStatement",
          "class": "OC\\DB\\Connection"
        },
        {
          "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 287,
          "function": "execute",
          "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
        },
        {
          "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 318,
          "function": "execute",
          "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
        },
        {
          "file": "/home/user/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
          "line": 211,
          "function": "executeUpdate",
          "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
        },
        {
          "file": "/home/user/nextcloud/apps/mail/lib/Db/MailboxMapper.php",
          "line": 228,
          "function": "update",
          "class": "OCP\\AppFramework\\Db\\QBMapper"
        },
        {
          "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 246,
          "function": "unlockFromVanishedSync",
          "class": "OCA\\Mail\\Db\\MailboxMapper"
        },
        {
          "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
          "line": 121,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
        },
        {
          "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
          "line": 161,
          "function": "syncMailbox",
          "class": "OCA\\Mail\\Service\\Sync\\SyncService"
        },
        {
          "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 218,
          "function": "sync",
          "class": "OCA\\Mail\\Controller\\MailboxesController"
        },
        {
          "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 127,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher"
        },
        {
          "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
          "line": 157,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher"
        },
        {
          "file": "/home/user/nextcloud/lib/private/Route/Router.php",
          "line": 302,
          "function": "main",
          "class": "OC\\AppFramework\\App"
        },
        {
          "file": "/home/user/nextcloud/lib/base.php",
          "line": 998,
          "function": "match",
          "class": "OC\\Route\\Router"
        },
        {
          "file": "/home/user/nextcloud/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC"
        }
      ],
      "previous": {
        "type": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
        "message": "SQLSTATE[HY000]: General error: 5 database is locked",
        "code": 5,
        "trace": [
          {
            "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
            "line": 84,
            "function": "new",
            "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
          },
          {
            "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
            "line": 1136,
            "function": "execute",
            "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement"
          },
          {
            "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
            "line": 260,
            "function": "executeStatement",
            "class": "Doctrine\\DBAL\\Connection"
          },
          {
            "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
            "line": 213,
            "function": "executeStatement",
            "class": "OC\\DB\\Connection"
          },
          {
            "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 287,
            "function": "execute",
            "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
          },
          {
            "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 318,
            "function": "execute",
            "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
          },
          {
            "file": "/home/user/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
            "line": 211,
            "function": "executeUpdate",
            "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
          },
          {
            "file": "/home/user/nextcloud/apps/mail/lib/Db/MailboxMapper.php",
            "line": 228,
            "function": "update",
            "class": "OCP\\AppFramework\\Db\\QBMapper"
          },
          {
            "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
            "line": 246,
            "function": "unlockFromVanishedSync",
            "class": "OCA\\Mail\\Db\\MailboxMapper"
          },
          {
            "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
            "line": 121,
            "function": "sync",
            "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
          },
          {
            "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
            "line": 161,
            "function": "syncMailbox",
            "class": "OCA\\Mail\\Service\\Sync\\SyncService"
          },
          {
            "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line": 218,
            "function": "sync",
            "class": "OCA\\Mail\\Controller\\MailboxesController"
          },
          {
            "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line": 127,
            "function": "executeController",
            "class": "OC\\AppFramework\\Http\\Dispatcher"
          },
          {
            "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
            "line": 157,
            "function": "dispatch",
            "class": "OC\\AppFramework\\Http\\Dispatcher"
          },
          {
            "file": "/home/user/nextcloud/lib/private/Route/Router.php",
            "line": 302,
            "function": "main",
            "class": "OC\\AppFramework\\App"
          },
          {
            "file": "/home/user/nextcloud/lib/base.php",
            "line": 998,
            "function": "match",
            "class": "OC\\Route\\Router"
          },
          {
            "file": "/home/user/nextcloud/index.php",
            "line": 37,
            "function": "handleRequest",
            "class": "OC"
          }
        ],
        "previous": {
          "type": "PDOException",
          "message": "SQLSTATE[HY000]: General error: 5 database is locked",
          "code": "HY000",
          "trace": [
            {
              "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
              "line": 82,
              "function": "execute",
              "class": "PDOStatement"
            },
            {
              "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
              "line": 1136,
              "function": "execute",
              "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement"
            },
            {
              "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
              "line": 260,
              "function": "executeStatement",
              "class": "Doctrine\\DBAL\\Connection"
            },
            {
              "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
              "line": 213,
              "function": "executeStatement",
              "class": "OC\\DB\\Connection"
            },
            {
              "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
              "line": 287,
              "function": "execute",
              "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
            },
            {
              "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
              "line": 318,
              "function": "execute",
              "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
            },
            {
              "file": "/home/user/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
              "line": 211,
              "function": "executeUpdate",
              "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
            },
            {
              "file": "/home/user/nextcloud/apps/mail/lib/Db/MailboxMapper.php",
              "line": 228,
              "function": "update",
              "class": "OCP\\AppFramework\\Db\\QBMapper"
            },
            {
              "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
              "line": 246,
              "function": "unlockFromVanishedSync",
              "class": "OCA\\Mail\\Db\\MailboxMapper"
            },
            {
              "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
              "line": 121,
              "function": "sync",
              "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
            },
            {
              "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
              "line": 161,
              "function": "syncMailbox",
              "class": "OCA\\Mail\\Service\\Sync\\SyncService"
            },
            {
              "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
              "line": 218,
              "function": "sync",
              "class": "OCA\\Mail\\Controller\\MailboxesController"
            },
            {
              "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
              "line": 127,
              "function": "executeController",
              "class": "OC\\AppFramework\\Http\\Dispatcher"
            },
            {
              "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
              "line": 157,
              "function": "dispatch",
              "class": "OC\\AppFramework\\Http\\Dispatcher"
            },
            {
              "file": "/home/user/nextcloud/lib/private/Route/Router.php",
              "line": 302,
              "function": "main",
              "class": "OC\\AppFramework\\App"
            },
            {
              "file": "/home/user/nextcloud/lib/base.php",
              "line": 998,
              "function": "match",
              "class": "OC\\Route\\Router"
            },
            {
              "file": "/home/user/nextcloud/index.php",
              "line": 37,
              "function": "handleRequest",
              "class": "OC"
            }
          ],
          "previous": {
            "type": "OCA\\Mail\\Exception\\ServiceException",
            "message": "Sync failed for 15:INBOX: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked",
            "code": 0,
            "trace": [
              {
                "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
                "line": 121,
                "function": "sync",
                "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
              },
              {
                "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
                "line": 161,
                "function": "syncMailbox",
                "class": "OCA\\Mail\\Service\\Sync\\SyncService"
              },
              {
                "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 218,
                "function": "sync",
                "class": "OCA\\Mail\\Controller\\MailboxesController"
              },
              {
                "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 127,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher"
              },
              {
                "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
                "line": 157,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher"
              },
              {
                "file": "/home/user/nextcloud/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App"
              },
              {
                "file": "/home/user/nextcloud/lib/base.php",
                "line": 998,
                "function": "match",
                "class": "OC\\Route\\Router"
              },
              {
                "file": "/home/user/nextcloud/index.php",
                "line": 37,
                "function": "handleRequest",
                "class": "OC"
              }
            ],
            "previous": {
              "type": "Doctrine\\DBAL\\Exception\\LockWaitTimeoutException",
              "message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked",
              "code": 5,
              "trace": [
                {
                  "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                  "line": 1728,
                  "function": "convert",
                  "class": "Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter"
                },
                {
                  "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                  "line": 1667,
                  "function": "handleDriverException",
                  "class": "Doctrine\\DBAL\\Connection"
                },
                {
                  "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                  "line": 1146,
                  "function": "convertExceptionDuringQuery",
                  "class": "Doctrine\\DBAL\\Connection"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
                  "line": 260,
                  "function": "executeStatement",
                  "class": "Doctrine\\DBAL\\Connection"
                },
                {
                  "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                  "line": 213,
                  "function": "executeStatement",
                  "class": "OC\\DB\\Connection"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                  "line": 287,
                  "function": "execute",
                  "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
                },
                {
                  "file": "/home/user/nextcloud/apps/mail/lib/Db/MessageMapper.php",
                  "line": 388,
                  "function": "execute",
                  "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
                },
                {
                  "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                  "line": 383,
                  "function": "updateBulk",
                  "class": "OCA\\Mail\\Db\\MessageMapper"
                },
                {
                  "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                  "line": 223,
                  "function": "runPartialSync",
                  "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                },
                {
                  "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
                  "line": 121,
                  "function": "sync",
                  "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                },
                {
                  "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
                  "line": 161,
                  "function": "syncMailbox",
                  "class": "OCA\\Mail\\Service\\Sync\\SyncService"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                  "line": 218,
                  "function": "sync",
                  "class": "OCA\\Mail\\Controller\\MailboxesController"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                  "line": 127,
                  "function": "executeController",
                  "class": "OC\\AppFramework\\Http\\Dispatcher"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
                  "line": 157,
                  "function": "dispatch",
                  "class": "OC\\AppFramework\\Http\\Dispatcher"
                },
                {
                  "file": "/home/user/nextcloud/lib/private/Route/Router.php",
                  "line": 302,
                  "function": "main",
                  "class": "OC\\AppFramework\\App"
                },
                {
                  "file": "/home/user/nextcloud/lib/base.php",
                  "line": 998,
                  "function": "match",
                  "class": "OC\\Route\\Router"
                },
                {
                  "file": "/home/user/nextcloud/index.php",
                  "line": 37,
                  "function": "handleRequest",
                  "class": "OC"
                }
              ],
              "previous": {
                "type": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                "message": "SQLSTATE[HY000]: General error: 5 database is locked",
                "code": 5,
                "trace": [
                  {
                    "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                    "line": 84,
                    "function": "new",
                    "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                  },
                  {
                    "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1136,
                    "function": "execute",
                    "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
                    "line": 260,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connection"
                  },
                  {
                    "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                    "line": 213,
                    "function": "executeStatement",
                    "class": "OC\\DB\\Connection"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                    "line": 287,
                    "function": "execute",
                    "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
                  },
                  {
                    "file": "/home/user/nextcloud/apps/mail/lib/Db/MessageMapper.php",
                    "line": 388,
                    "function": "execute",
                    "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
                  },
                  {
                    "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                    "line": 383,
                    "function": "updateBulk",
                    "class": "OCA\\Mail\\Db\\MessageMapper"
                  },
                  {
                    "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                    "line": 223,
                    "function": "runPartialSync",
                    "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                  },
                  {
                    "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
                    "line": 121,
                    "function": "sync",
                    "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                  },
                  {
                    "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
                    "line": 161,
                    "function": "syncMailbox",
                    "class": "OCA\\Mail\\Service\\Sync\\SyncService"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 218,
                    "function": "sync",
                    "class": "OCA\\Mail\\Controller\\MailboxesController"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 127,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
                    "line": 157,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/private/Route/Router.php",
                    "line": 302,
                    "function": "main",
                    "class": "OC\\AppFramework\\App"
                  },
                  {
                    "file": "/home/user/nextcloud/lib/base.php",
                    "line": 998,
                    "function": "match",
                    "class": "OC\\Route\\Router"
                  },
                  {
                    "file": "/home/user/nextcloud/index.php",
                    "line": 37,
                    "function": "handleRequest",
                    "class": "OC"
                  }
                ],
                "previous": {
                  "type": "PDOException",
                  "message": "SQLSTATE[HY000]: General error: 5 database is locked",
                  "code": "HY000",
                  "trace": [
                    {
                      "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                      "line": 82,
                      "function": "execute",
                      "class": "PDOStatement"
                    },
                    {
                      "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                      "line": 1136,
                      "function": "execute",
                      "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/DB/Connection.php",
                      "line": 260,
                      "function": "executeStatement",
                      "class": "Doctrine\\DBAL\\Connection"
                    },
                    {
                      "file": "/home/user/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                      "line": 213,
                      "function": "executeStatement",
                      "class": "OC\\DB\\Connection"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                      "line": 287,
                      "function": "execute",
                      "class": "Doctrine\\DBAL\\Query\\QueryBuilder"
                    },
                    {
                      "file": "/home/user/nextcloud/apps/mail/lib/Db/MessageMapper.php",
                      "line": 388,
                      "function": "execute",
                      "class": "OC\\DB\\QueryBuilder\\QueryBuilder"
                    },
                    {
                      "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                      "line": 383,
                      "function": "updateBulk",
                      "class": "OCA\\Mail\\Db\\MessageMapper"
                    },
                    {
                      "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                      "line": 223,
                      "function": "runPartialSync",
                      "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                    },
                    {
                      "file": "/home/user/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
                      "line": 121,
                      "function": "sync",
                      "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer"
                    },
                    {
                      "file": "/home/user/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
                      "line": 161,
                      "function": "syncMailbox",
                      "class": "OCA\\Mail\\Service\\Sync\\SyncService"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                      "line": 218,
                      "function": "sync",
                      "class": "OCA\\Mail\\Controller\\MailboxesController"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                      "line": 127,
                      "function": "executeController",
                      "class": "OC\\AppFramework\\Http\\Dispatcher"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/AppFramework/App.php",
                      "line": 157,
                      "function": "dispatch",
                      "class": "OC\\AppFramework\\Http\\Dispatcher"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/private/Route/Router.php",
                      "line": 302,
                      "function": "main",
                      "class": "OC\\AppFramework\\App"
                    },
                    {
                      "file": "/home/user/nextcloud/lib/base.php",
                      "line": 998,
                      "function": "match",
                      "class": "OC\\Route\\Router"
                    },
                    {
                      "file": "/home/user/nextcloud/index.php",
                      "line": 37,
                      "function": "handleRequest",
                      "class": "OC"
                    }
                  ],
                  "previous": null
                }
              }
            }
          }
        }
      }
    }
  },
  "code": 5
}
@st3iny
Copy link
Member

st3iny commented Mar 25, 2021

Is this fixed by #4819? The issue can be closed then.

@ChristophWurst
Copy link
Member

Is this fixed by #4819? The issue can be closed then.

Not quite. #4819 just helps with the automatic unlocking, but the mystery of why the database was locked is yet to be solved :)

@st3iny
Copy link
Member

st3iny commented Mar 25, 2021

Alright. I noticed @miaulalala using See instead of Fixes in some PR descriptions and was not sure if this was intended or not :D

@miaulalala
Copy link
Contributor

Alright. I noticed @miaulalala using See instead of Fixes in some PR descriptions and was not sure if this was intended or not :D

Oh, I didn't know there was a standard for this 😬

@miaulalala
Copy link
Contributor

I haven't had this issue in a while now. Closing.

@sazanof
Copy link
Collaborator

sazanof commented Mar 17, 2022

Hello guys!

I transfer mail using the imapsync utility from an office 365 server to a server with postfix dovecot. NC is located on the same server.
Mailboxes (10 test ones in total) are linked to users automatically (your very cool feature!).
After syncing with imapsync, I log into the user's mailbox and notice that emails are not uploaded to all folders.
I open the console, I see
{"status":"fail","data":{"message":"34 is already being synced","type":"OCA\\Mail\\Exception\\MailboxLockedException"}}
I log on to the server. Executing the command
sudo -u www-data php occ mail:account:sync 1
At the moment, while I am writing this text, the command is being executed. It may be executed correctly

[debug] Syncing 62
[debug] Locking mailbox 62 for new messages sync
[debug] Locking mailbox 62 for changed messages sync
[debug] Locking mailbox 62 for vanished messages sync
[debug] Running initial sync for 62
[debug] Initial sync 315:INBOX - fetch all messages from IMAP took 0s
[debug] Initial sync 315:INBOX - persist messages in database took 0s
[debug] Initial sync 315:INBOX took 0s
[debug] Unlocking mailbox 62 from vanished messages sync
[debug] Unlocking mailbox 62 from changed messages sync
[debug] Unlocking mailbox 62 from new messages sync

... There is a 409 error in the mail web interface. We're waiting....

Sometimes there is an exception with the text "NNN is already being synced"

I looked at the source code and saw that the table with emails was being blocked.
Opened mysql
select count(*) from oc_mail_messages;
outputs 10001 message. During the execution of the occ command, the number of emails does not change in the database.

I don't quite understand, can you explain the algorithm why this can happen, why the database is constantly blocked?

I assumed that synchronization should be performed once (or it is performed by the crown) for one mailbox. And everything.

I've been testing NC mail for 4 days now. And this error appears in the mail constantly. Maybe block the table for writing, but allow it to be read, I don't know.

If, say, there are 6 thousand letters in one mailbox, how are they recorded in the database? This process happens once, but in portions? Maybe I should just "wait"? =)

root@post:/var/www/nextcloud# sudo -u www-data php occ mail:account:diagnose 1
IMAP capabilities:
- AUTH
- ENABLE
- ID
- IDLE
- IMAP4REV1
- LITERAL+
- LOGIN-REFERRALS
- SASL-IR
Account has 6890 messages in 34 mailboxes

Well, I have completed the text, and so far the synchronization is being performed (the same thing is in progress).
Tell me please, im confused=).

@sazanof
Copy link
Collaborator

sazanof commented Mar 17, 2022

Proof - Right now in the console https://disk.yandex.ru/i/bCZATScyD_6cvA =(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants