nextcloud / nextcloud/mail

OCA Mail Exception ServiceException: Could not deserialize persisted classifier

Open
#8,403 1 comment 1 reaction 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

Steps to reproduce
  1. Use the mail app with a lot of emails
  2. I dont know what sort of emails might cause this problem
  3. If I did, maybe I could do something about it
Expected behavior

No errors

Also, in my directory /var/www/vhosts/reeves.one/oc-data/appdata_oc9765749522/mail/classifiers there are 26344 files, from June 2021 on. Can this be cleaned up?

Actual behavior

`[mail] Warnung: OCA\Mail\Exception\ServiceException: Could not deserialize persisted classifier 26315: Unrecognized message format. at <>

  1. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 165
    OCA\Mail\Service\Classification\PersistenceService->load()
  2. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/ImportanceClassifier.php line 306
    OCA\Mail\Service\Classification\PersistenceService->loadLatest()
  3. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Listener/NewMessageClassificationListener.php line 121
    OCA\Mail\Service\Classification\ImportanceClassifier->classifyImportance()
  4. /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/ServiceEventListener.php line 86
    OCA\Mail\Listener\NewMessageClassificationListener->handle()
  5. /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
  6. /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
  7. /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/EventDispatcher.php line 87
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
  8. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 404
    OC\EventDispatcher\EventDispatcher->dispatch()
  9. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 236
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->runPartialSync()
  10. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 137
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync("*** sensitive parameters replaced ***")
  11. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/BackgroundJob/SyncJob.php line 110
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount("*** sensitive parameters replaced ***")
  12. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/Job.php line 78
    OCA\Mail\BackgroundJob\SyncJob->run()
  13. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 103
    OCP\BackgroundJob\Job->start()
  14. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 93
    OCP\BackgroundJob\TimedJob->start()
  15. /var/www/vhosts/example.com/owncloud.example.com/cron.php line 152
    OCP\BackgroundJob\TimedJob->execute()

Caused by:

Rubix\ML\Exceptions\RuntimeException: Unrecognized message format. at <>

  1. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/vendor/rubix/ml/src/PersistentModel.php line 59
    Rubix\ML\Serializers\RBX->deserialize()
  2. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 205
    Rubix\ML\PersistentModel::load()
  3. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 165
    OCA\Mail\Service\Classification\PersistenceService->load()
  4. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/ImportanceClassifier.php line 306
    OCA\Mail\Service\Classification\PersistenceService->loadLatest()
  5. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Listener/NewMessageClassificationListener.php line 121
    OCA\Mail\Service\Classification\ImportanceClassifier->classifyImportance()
  6. /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/ServiceEventListener.php line 86
    OCA\Mail\Listener\NewMessageClassificationListener->handle()
  7. /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
  8. /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
  9. /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/EventDispatcher.php line 87
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
  10. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 404
    OC\EventDispatcher\EventDispatcher->dispatch()
  11. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 236
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->runPartialSync()
  12. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 137
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync("*** sensitive parameters replaced ***")
  13. /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/BackgroundJob/SyncJob.php line 110
    OCA\Mail\Service\Sync\ImapToDbSynchronizer->syncAccount("*** sensitive parameters replaced ***")
  14. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/Job.php line 78
    OCA\Mail\BackgroundJob\SyncJob->run()
  15. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 103
    OCP\BackgroundJob\Job->start()
  16. /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 93
    OCP\BackgroundJob\TimedJob->start()
  17. /var/www/vhosts/example.com/owncloud.example.com/cron.php line 152
    OCP\BackgroundJob\TimedJob->execute()

at 2023-04-24T15:30:03+00:00`

Mail app version

3.1.1

Mailserver or service

Postfix (run under Plesk)

Operating system

Debian 10

PHP engine version

PHP 8.1

Web server

Nginx

Database

MariaDB

Additional info

There are three classifiers being complained about, but two are identical, here are the two causing messages:

O:31:"Rubix\ML\Classifiers\GaussianNB":5:{s:12:"258714;}s:12:"i:1;d:0.99917495319342;i:2;d:0.13576235355309604;i:3;d:0.021654749744637342;}s:1:"i";a:4:{i:0;d:1;i:1;d:0.76190476190476 19;i:2;d:0.14285714285714285;i:3;d:0;}}s:12:"d:0.05229874859502177;i:3;d:0.0038620217624246358;}s:1:"i";a:4:{i:0;d:1.0E-8;i:1;d:0.11791383219954649;i:2;d:0.098639455 78231291;i:3;d:1.0E-8;}}}

O:31:"Rubix\ML\Classifiers\GaussianNB":5:{s:12:"39435;}s:12:"16391844437156;i:1;d:1;i:2;d:0.12667817559299138;i:3;d:0.03952569169960475;}s:2:"ni";a:4:{i:0;d:0.019733516254062056;i:1 ;d:1;i:2;d:0.09390873324901736;i:3;d:0.017375968100605484;}}s:12:"6;i:1;d:1.0E-8;i:2;d:0.033438734413303875;i:3;d:0.0027683606992766627;}s:2:"ni";a:4:{i:0;d:0.0037046587207046977;i:1;d:1 .0E-8;i:2;d:0.027757771656291085;i:3;d:0.0005322342226798502;}}}

Can I delete all these classifiers, so that NC-Mail will recreate the ones it needs?

Thanks, Tim

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, especially load() and loadLatest(), then trace their use from ImportanceClassifier.php. Inspect how the classifier files in the appdata mail/classifiers directory are persisted and loaded; done means establishing why the serialized files cannot be deserialized and defining safe cleanup or recovery behavior without recurring warnings.

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.