nextcloud / nextcloud/mail

Could not load classifier

Open
#5,506 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. to triage bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Mail app

Mail app version: 1.10.3

Mailserver or service: IMAP from ISP

Logs

I have hundreds of messages like these in the logs.
How can I help fix/debug these?

{
  "reqId": "qJN83yPOSeJwD78x4ihM",
  "level": 3,
  "time": "2021-09-04T10:19:56+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "mail",
  "method": "",
  "url": "--",
  "message": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Could not load classifier 1126: /appdata_ocelogm5tb1d/mail/classifiers/1126",
    "Code": 0,
    "Trace": [
      {
        "file": "/apps/mail/lib/Service/Classification/PersistenceService.php",
        "line": 162,
        "function": "load",
        "class": "OCA\\Mail\\Service\\Classification\\PersistenceService",
        "type": "->",
        "args": [
          1126
        ]
      },
      {
        "file": "/apps/mail/lib/Service/Classification/ImportanceClassifier.php",
        "line": 301,
        "function": "loadLatest",
        "class": "OCA\\Mail\\Service\\Classification\\PersistenceService",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Account"
          }
        ]
      },
      {
        "file": "/apps/mail/lib/Listener/NewMessageClassificationListener.php",
        "line": 118,
        "function": "classifyImportance",
        "class": "OCA\\Mail\\Service\\Classification\\ImportanceClassifier",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Account"
          },
          {
            "id": 64,
            "__class__": "OCA\\Mail\\Db\\Mailbox"
          },
          [
            {
              "id": null,
              "__class__": "OCA\\Mail\\Db\\Message"
            },
            {
              "id": null,
              "__class__": "OCA\\Mail\\Db\\Message"
            },
            {
              "id": null,
              "__class__": "OCA\\Mail\\Db\\Message"
            }
          ]
        ]
      },
      {
        "file": "/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 76,
        "function": "handle",
        "class": "OCA\\Mail\\Listener\\NewMessageClassificationListener",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
          }
        ]
      },
      {
        "file": "/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 251,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
          },
          "OCA\\Mail\\Events\\NewMessagesSynchronized",
          {
            "__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
          }
        ]
      },
      {
        "file": "/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 73,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            {
              "__class__": "Closure"
            }
          ],
          "OCA\\Mail\\Events\\NewMessagesSynchronized",
          {
            "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
          }
        ]
      },
      {
        "file": "/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 86,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
          },
          "OCA\\Mail\\Events\\NewMessagesSynchronized"
        ]
      },
      {
        "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 380,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          "OCA\\Mail\\Events\\NewMessagesSynchronized",
          {
            "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
          }
        ]
      },
      {
        "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 230,
        "function": "runPartialSync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Account"
          },
          {
            "id": 64,
            "__class__": "OCA\\Mail\\Db\\Mailbox"
          },
          {
            "__class__": "OC\\AppFramework\\ScopedPsrLogger"
          },
          42,
          null
        ]
      },
      {
        "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 135,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Account"
          },
          {
            "id": 64,
            "__class__": "OCA\\Mail\\Db\\Mailbox"
          },
          {
            "__class__": "OC\\AppFramework\\ScopedPsrLogger"
          },
          42,
          null,
          false,
          true
        ]
      },
      {
        "file": "/apps/mail/lib/BackgroundJob/SyncJob.php",
        "line": 109,
        "function": "syncAccount",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Mail\\Account"
          },
          {
            "__class__": "OC\\AppFramework\\ScopedPsrLogger"
          }
        ]
      },
      {
        "file": "/lib/public/BackgroundJob/Job.php",
        "line": 80,
        "function": "run",
        "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
        "type": "->",
        "args": [
          {
            "accountId": 3
          }
        ]
      },
      {
        "file": "/lib/public/BackgroundJob/TimedJob.php",
        "line": 61,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\BackgroundJob\\JobList"
          },
          {
            "__class__": "OC\\Log"
          }
        ]
      },
      {
        "file": "/cron.php",
        "line": 128,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\BackgroundJob\\JobList"
          },
          {
            "__class__": "OC\\Log"
          }
        ]
      }
    ],
    "File": "/apps/mail/lib/Service/Classification/PersistenceService.php",
    "Line": 183,
    "Previous": {
      "Exception": "OCP\\Files\\NotFoundException",
      "Message": "/appdata_ocelogm5tb1d/mail/classifiers/1126",
      "Code": 0,
      "Trace": [
        {
          "file": "/lib/private/Files/Node/Folder.php",
          "line": 149,
          "function": "get",
          "class": "OC\\Files\\Node\\Root",
          "type": "->",
          "args": [
            "/appdata_ocelogm5tb1d/mail/classifiers/1126"
          ]
        },
        {
          "file": "/lib/private/Files/SimpleFS/SimpleFolder.php",
          "line": 76,
          "function": "get",
          "class": "OC\\Files\\Node\\Folder",
          "type": "->",
          "args": [
            "1126"
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Classification/PersistenceService.php",
          "line": 180,
          "function": "getFile",
          "class": "OC\\Files\\SimpleFS\\SimpleFolder",
          "type": "->",
          "args": [
            "1126"
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Classification/PersistenceService.php",
          "line": 162,
          "function": "load",
          "class": "OCA\\Mail\\Service\\Classification\\PersistenceService",
          "type": "->",
          "args": [
            1126
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Classification/ImportanceClassifier.php",
          "line": 301,
          "function": "loadLatest",
          "class": "OCA\\Mail\\Service\\Classification\\PersistenceService",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Account"
            }
          ]
        },
        {
          "file": "/apps/mail/lib/Listener/NewMessageClassificationListener.php",
          "line": 118,
          "function": "classifyImportance",
          "class": "OCA\\Mail\\Service\\Classification\\ImportanceClassifier",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Account"
            },
            {
              "id": 64,
              "__class__": "OCA\\Mail\\Db\\Mailbox"
            },
            [
              {
                "id": null,
                "__class__": "OCA\\Mail\\Db\\Message"
              },
              {
                "id": null,
                "__class__": "OCA\\Mail\\Db\\Message"
              },
              {
                "id": null,
                "__class__": "OCA\\Mail\\Db\\Message"
              }
            ]
          ]
        },
        {
          "file": "/lib/private/EventDispatcher/ServiceEventListener.php",
          "line": 76,
          "function": "handle",
          "class": "OCA\\Mail\\Listener\\NewMessageClassificationListener",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
            }
          ]
        },
        {
          "file": "/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 251,
          "function": "__invoke",
          "class": "OC\\EventDispatcher\\ServiceEventListener",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
            },
            "OCA\\Mail\\Events\\NewMessagesSynchronized",
            {
              "__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
            }
          ]
        },
        {
          "file": "/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 73,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              {
                "__class__": "Closure"
              }
            ],
            "OCA\\Mail\\Events\\NewMessagesSynchronized",
            {
              "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
            }
          ]
        },
        {
          "file": "/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 86,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
            },
            "OCA\\Mail\\Events\\NewMessagesSynchronized"
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 380,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            "OCA\\Mail\\Events\\NewMessagesSynchronized",
            {
              "__class__": "OCA\\Mail\\Events\\NewMessagesSynchronized"
            }
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 230,
          "function": "runPartialSync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Account"
            },
            {
              "id": 64,
              "__class__": "OCA\\Mail\\Db\\Mailbox"
            },
            {
              "__class__": "OC\\AppFramework\\ScopedPsrLogger"
            },
            42,
            null
          ]
        },
        {
          "file": "/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 135,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Account"
            },
            {
              "id": 64,
              "__class__": "OCA\\Mail\\Db\\Mailbox"
            },
            {
              "__class__": "OC\\AppFramework\\ScopedPsrLogger"
            },
            42,
            null,
            false,
            true
          ]
        },
        {
          "file": "/apps/mail/lib/BackgroundJob/SyncJob.php",
          "line": 109,
          "function": "syncAccount",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\Mail\\Account"
            },
            {
              "__class__": "OC\\AppFramework\\ScopedPsrLogger"
            }
          ]
        },
        {
          "file": "/lib/public/BackgroundJob/Job.php",
          "line": 80,
          "function": "run",
          "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
          "type": "->",
          "args": [
            {
              "accountId": 3
            }
          ]
        },
        {
          "file": "/lib/public/BackgroundJob/TimedJob.php",
          "line": 61,
          "function": "execute",
          "class": "OCP\\BackgroundJob\\Job",
          "type": "->",
          "args": [
            {
              "__class__": "OC\\BackgroundJob\\JobList"
            },
            {
              "__class__": "OC\\Log"
            }
          ]
        },
        {
          "file": "/cron.php",
          "line": 128,
          "function": "execute",
          "class": "OCP\\BackgroundJob\\TimedJob",
          "type": "->",
          "args": [
            {
              "__class__": "OC\\BackgroundJob\\JobList"
            },
            {
              "__class__": "OC\\Log"
            }
          ]
        }
      ],
      "File": "/lib/private/Files/Node/Root.php",
      "Line": 205
    },
    "CustomMessage": "Could not classify incoming message importance: Could not load classifier 1126: /appdata_ocelogm5tb1d/mail/classifiers/1126"
  },
  "userAgent": "--",
  "version": "21.0.4.1",
  "id": "61333a3d24375"
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/mail/lib/Service/Classification/PersistenceService.php around lines 162-183, then trace the callers in ImportanceClassifier.php, NewMessageClassificationListener.php, and ImapToDbSynchronizer.php. Determine why classifier 1126 is missing during synchronization; the report does not define a specific fix or completion test, so confirm the intended behavior with maintainers before changing code.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.