mail icon indicating copy to clipboard operation
mail copied to clipboard

Excessive log file entries

Open wriver4 opened this issue 11 months ago • 5 comments

Steps to reproduce

1.Regular operation 2. 3.

Expected behavior

No log entry

Actual behavior

{
  "reqId": "Z6Z9GL2aCX0CCfpPluKJWAAAAAE",
  "level": 3,
  "time": "2025-02-07T21:37:28+00:00",
  "remoteAddr": "136.61.208.132",
  "user": "leonwittman",
  "app": "core",
  "method": "POST",
  "url": "/index.php/apps/mail/api/mailboxes/4532/sync",
  "message": "More than 1000 expressions in a list are not allowed on Oracle.",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
  "version": "30.0.5.1",
  "exception": {
    "Exception": "Doctrine\\DBAL\\Query\\QueryException",
    "Message": "More than 1000 expressions in a list are not allowed on Oracle.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 284,
        "function": "prepareForExecute",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Db/StatisticsDao.php",
        "line": 185,
        "function": "executeQuery",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Classification/FeatureExtraction/ReadMessagesExtractor.php",
        "line": 45,
        "function": "getNumberOfMessagesWithFlagGrouped",
        "class": "OCA\\Mail\\Db\\StatisticsDao",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Classification/FeatureExtraction/CompositeExtractor.php",
        "line": 40,
        "function": "prepare",
        "class": "OCA\\Mail\\Service\\Classification\\FeatureExtraction\\ReadMessagesExtractor",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Classification/ImportanceClassifier.php",
        "line": 263,
        "function": "prepare",
        "class": "OCA\\Mail\\Service\\Classification\\FeatureExtraction\\CompositeExtractor",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Classification/ImportanceClassifier.php",
        "line": 314,
        "function": "getFeaturesAndImportance",
        "class": "OCA\\Mail\\Service\\Classification\\ImportanceClassifier",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Listener/NewMessageClassificationListener.php",
        "line": 102,
        "function": "classifyImportance",
        "class": "OCA\\Mail\\Service\\Classification\\ImportanceClassifier",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 68,
        "function": "handle",
        "class": "OCA\\Mail\\Listener\\NewMessageClassificationListener",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 220,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 56,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 67,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 423,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 251,
        "function": "runPartialSync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Service/Sync/SyncService.php",
        "line": 126,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/apps/mail/lib/Controller/MailboxesController.php",
        "line": 144,
        "function": "syncMailbox",
        "class": "OCA\\Mail\\Service\\Sync\\SyncService",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 208,
        "function": "sync",
        "class": "OCA\\Mail\\Controller\\MailboxesController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/lib/base.php",
        "line": 1003,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/cloud.waveguardco.net/public_html/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/cloud.waveguardco.net/public_html/lib/private/DB/QueryBuilder/QueryBuilder.php",
    "Line": 237,
    "message": "More than 1000 expressions in a list are not allowed on Oracle.",
    "query": "SELECT `r`.`email` AS `email`, COUNT(*) AS `count` FROM `*PREFIX*mail_recipients` `r` INNER JOIN `*PREFIX*mail_messages` `m` ON `m`.`id` = `r`.`message_id` WHERE (`r`.`type` = :dcValue1) AND (`m`.`mailbox_id` IN (:dcValue2)) AND (`m`.`flag_seen` = :dcValue3) AND (`r`.`email` IN (:dcValue4)) GROUP BY `r`.`email`",
    "exception": [],
    "CustomMessage": "More than 1000 expressions in a list are not allowed on Oracle."
  },
  "id": "67a68534b51c8"
}

Mail app version

4.1.2

Nextcloud version

30.0.5

Mailserver or service

Postfix, dovecot

Operating system

Linux 5.15.0-130-generic x86_64

PHP engine version

PHP 8.3

Nextcloud memory caching

memcache.local

Web server

Apache (supported)

Database

MySQL

Additional info

I truncated the log and the first error was immediate. 15 errors in the logs since January 31, 2025, 5:22:23 PM

The mail box is for our mail sales person.

wriver4 avatar Feb 07 '25 22:02 wriver4

I don't have a dev. server. I read what you did in other areas of the code. I just need you to tell me which file to add the chunk code to fix this issue. While bad practice, I don't have a problem editing the production code.

wriver4 avatar Feb 09 '25 19:02 wriver4

And I realize it might get changed due to updates.

wriver4 avatar Feb 09 '25 19:02 wriver4

@wriver4 Looks like we are hitting a Oracle limitation, of 1000 records when classifing messages.

Thank you for the report, we will try to address this with a future fix.

SebastianKrupinski avatar Feb 10 '25 16:02 SebastianKrupinski

Soon, I hope.

wriver4 avatar Feb 26 '25 14:02 wriver4

Related: #9069

joshtrichards avatar May 15 '25 15:05 joshtrichards

Fix at https://github.com/nextcloud/mail/pull/11689

ChristophWurst avatar Sep 16 '25 09:09 ChristophWurst