nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
833 stars 258 forks source link

One of email accounts is non stop refreshing in inbox #7554

Open Avrantinis opened 1 year ago

Avrantinis commented 1 year ago

Steps to reproduce

  1. Not sure if anyone can reproduce it.
  2. I have some email accounts under 2 different domains. All works fine except one spesific email address but all under the same settings.
  3. This happens in inbox and favorites only. Have tryied in earlier versions with the same behaviour

Expected behavior

Should just load the list of inbox or favorite mails

Actual behavior

It is non stop refreshing the inbox and favorites lists.

Mail app version

2.1.0

Mailserver or service

Webmail

Operating system

No response

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database

MySQL

Additional info

Just happens in a spesific email address that starts label@ there is other difference between setting and email addresses. Thanks

miaulalala commented 1 year ago

Can you look at your logs and copy your imap log? Description on how to get that here: https://github.com/nextcloud/mail/blob/main/doc/admin.md#logging

Avrantinis commented 1 year ago

Thanks, I get too many of these strings:

{
    "reqId": "Y2vs7526y5V-AiXDijrq7gAAAYQ",
    "level": 3,
    "time": "2022-11-09T18:09:52+00:00",
    "remoteAddr": "37.6.3.212",
    "user": "admin",
    "app": "mail",
    "method": "POST",
    "url": "/index.php/apps/mail/api/mailboxes/74/sync",
    "message": "Sync failed for 11:INBOX: An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
    "version": "25.0.1.1",
    "exception": {
        "Exception": "OCA\\Mail\\Exception\\ServiceException",
        "Message": "Sync failed for 11:INBOX: An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
        "Code": 0,
        "Trace": [
            {
                "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/SyncService.php",
                "line": 126,
                "function": "sync",
                "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Controller/MailboxesController.php",
                "line": 153,
                "function": "syncMailbox",
                "class": "OCA\\Mail\\Service\\Sync\\SyncService",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 225,
                "function": "sync",
                "class": "OCA\\Mail\\Controller\\MailboxesController",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 133,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/App.php",
                "line": 172,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/lib/private/Route/Router.php",
                "line": 298,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/lib/base.php",
                "line": 1047,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/home/at383439/cloud.athensmusic.gr/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "Line": 254,
        "Previous": {
            "Exception": "Doctrine\\DBAL\\Exception\\DriverException",
            "Message": "An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
            "Code": 1366,
            "Trace": [
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1780,
                    "function": "convert",
                    "class": "Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1719,
                    "function": "handleDriverException",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1173,
                    "function": "convertExceptionDuringQuery",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/Connection.php",
                    "line": 294,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                    "line": 354,
                    "function": "executeStatement",
                    "class": "OC\\DB\\Connection",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/QueryBuilder/QueryBuilder.php",
                    "line": 281,
                    "function": "execute",
                    "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Db/MessageMapper.php",
                    "line": 315,
                    "function": "execute",
                    "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                    "line": 316,
                    "function": "insertBulk",
                    "class": "OCA\\Mail\\Db\\MessageMapper",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                    "line": 230,
                    "function": "runInitialSync",
                    "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/SyncService.php",
                    "line": 126,
                    "function": "sync",
                    "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Controller/MailboxesController.php",
                    "line": 153,
                    "function": "syncMailbox",
                    "class": "OCA\\Mail\\Service\\Sync\\SyncService",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 225,
                    "function": "sync",
                    "class": "OCA\\Mail\\Controller\\MailboxesController",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 133,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/App.php",
                    "line": 172,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/private/Route/Router.php",
                    "line": 298,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/lib/base.php",
                    "line": 1047,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->"
                },
                {
                    "file": "/home/at383439/cloud.athensmusic.gr/index.php",
                    "line": 36,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::"
                }
            ],
            "File": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
            "Line": 114,
            "Previous": {
                "Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                "Message": "SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
                "Code": 1366,
                "Trace": [
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                        "line": 94,
                        "function": "new",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                        "type": "::"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Connection.php",
                        "line": 1163,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/Connection.php",
                        "line": 294,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                        "line": 354,
                        "function": "executeStatement",
                        "class": "OC\\DB\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/QueryBuilder/QueryBuilder.php",
                        "line": 281,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Db/MessageMapper.php",
                        "line": 315,
                        "function": "execute",
                        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                        "line": 316,
                        "function": "insertBulk",
                        "class": "OCA\\Mail\\Db\\MessageMapper",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                        "line": 230,
                        "function": "runInitialSync",
                        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/SyncService.php",
                        "line": 126,
                        "function": "sync",
                        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Controller/MailboxesController.php",
                        "line": 153,
                        "function": "syncMailbox",
                        "class": "OCA\\Mail\\Service\\Sync\\SyncService",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                        "line": 225,
                        "function": "sync",
                        "class": "OCA\\Mail\\Controller\\MailboxesController",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                        "line": 133,
                        "function": "executeController",
                        "class": "OC\\AppFramework\\Http\\Dispatcher",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/App.php",
                        "line": 172,
                        "function": "dispatch",
                        "class": "OC\\AppFramework\\Http\\Dispatcher",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/private/Route/Router.php",
                        "line": 298,
                        "function": "main",
                        "class": "OC\\AppFramework\\App",
                        "type": "::"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/lib/base.php",
                        "line": 1047,
                        "function": "match",
                        "class": "OC\\Route\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/home/at383439/cloud.athensmusic.gr/index.php",
                        "line": 36,
                        "function": "handleRequest",
                        "class": "OC",
                        "type": "::"
                    }
                ],
                "File": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
                "Line": 26,
                "Previous": {
                    "Exception": "PDOException",
                    "Message": "SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
                    "Code": "22007",
                    "Trace": [
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                            "line": 92,
                            "function": "execute",
                            "class": "PDOStatement",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Connection.php",
                            "line": 1163,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/Connection.php",
                            "line": 294,
                            "function": "executeStatement",
                            "class": "Doctrine\\DBAL\\Connection",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                            "line": 354,
                            "function": "executeStatement",
                            "class": "OC\\DB\\Connection",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/DB/QueryBuilder/QueryBuilder.php",
                            "line": 281,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Db/MessageMapper.php",
                            "line": 315,
                            "function": "execute",
                            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                            "line": 316,
                            "function": "insertBulk",
                            "class": "OCA\\Mail\\Db\\MessageMapper",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
                            "line": 230,
                            "function": "runInitialSync",
                            "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Service/Sync/SyncService.php",
                            "line": 126,
                            "function": "sync",
                            "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/apps/mail/lib/Controller/MailboxesController.php",
                            "line": 153,
                            "function": "syncMailbox",
                            "class": "OCA\\Mail\\Service\\Sync\\SyncService",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                            "line": 225,
                            "function": "sync",
                            "class": "OCA\\Mail\\Controller\\MailboxesController",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/Http/Dispatcher.php",
                            "line": 133,
                            "function": "executeController",
                            "class": "OC\\AppFramework\\Http\\Dispatcher",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/AppFramework/App.php",
                            "line": 172,
                            "function": "dispatch",
                            "class": "OC\\AppFramework\\Http\\Dispatcher",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/private/Route/Router.php",
                            "line": 298,
                            "function": "main",
                            "class": "OC\\AppFramework\\App",
                            "type": "::"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/lib/base.php",
                            "line": 1047,
                            "function": "match",
                            "class": "OC\\Route\\Router",
                            "type": "->"
                        },
                        {
                            "file": "/home/at383439/cloud.athensmusic.gr/index.php",
                            "line": 36,
                            "function": "handleRequest",
                            "class": "OC",
                            "type": "::"
                        }
                    ],
                    "File": "/home/at383439/cloud.athensmusic.gr/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                    "Line": 92
                }
            }
        },
        "message": "Sync failed for 11:INBOX: An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1",
        "exception": {},
        "CustomMessage": "Sync failed for 11:INBOX: An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xF0\\x9F\\x91\\x8B P...' for column `at383439_nextc89`.`oc_mail_messages`.`subject` at row 1"
    }
}
miaulalala commented 1 year ago

Please also post your data/horde_imap.log. I need to see what values are synced.

Avrantinis commented 1 year ago

Its an 25Mb file, so i share it in a nextcloud link here: https://cloud.athensmusic.gr/index.php/s/FJTa4bjM3qADsnH Thanks!

ChristophWurst commented 1 year ago

https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/mysql_4byte_support.html

Avrantinis commented 1 year ago

Not solved yet mysql.utf8mb4 was already to "true" in config.php MySql collation returns to "utf8mb4_bin" after the whole procedure. What Im trying through cpanel:

  1. Maintenance mode in terminal using php occ maintenance:mode --on
  2. Collation to utf8mb4_general_ci in phpMyadmin (seems to keep it after page refresh)
  3. 'mysql.utf8mb4' => true, in config.php
  4. php occ maintenance:repair in terminal
  5. occ maintenance:mode --off in terminal
  6. Issue keeps the same