OCA Mail Exception ServiceException: Could not deserialize persisted classifier
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Use the mail app with a lot of emails
- I dont know what sort of emails might cause this problem
- 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 <>
- /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 165
OCA\Mail\Service\Classification\PersistenceService->load() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/ImportanceClassifier.php line 306
OCA\Mail\Service\Classification\PersistenceService->loadLatest() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Listener/NewMessageClassificationListener.php line 121
OCA\Mail\Service\Classification\ImportanceClassifier->classifyImportance() - /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/ServiceEventListener.php line 86
OCA\Mail\Listener\NewMessageClassificationListener->handle() - /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
OC\EventDispatcher\ServiceEventListener->__invoke() - /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() - /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/EventDispatcher.php line 87
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 404
OC\EventDispatcher\EventDispatcher->dispatch() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 236
OCA\Mail\Service\Sync\ImapToDbSynchronizer->runPartialSync() - /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 ***") - /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 ***") - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/Job.php line 78
OCA\Mail\BackgroundJob\SyncJob->run() - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 103
OCP\BackgroundJob\Job->start() - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 93
OCP\BackgroundJob\TimedJob->start() - /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 <>
- /var/www/vhosts/example.com/owncloud.example.com/apps/mail/vendor/rubix/ml/src/PersistentModel.php line 59
Rubix\ML\Serializers\RBX->deserialize() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 205
Rubix\ML\PersistentModel::load() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/PersistenceService.php line 165
OCA\Mail\Service\Classification\PersistenceService->load() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Classification/ImportanceClassifier.php line 306
OCA\Mail\Service\Classification\PersistenceService->loadLatest() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Listener/NewMessageClassificationListener.php line 121
OCA\Mail\Service\Classification\ImportanceClassifier->classifyImportance() - /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/ServiceEventListener.php line 86
OCA\Mail\Listener\NewMessageClassificationListener->handle() - /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
OC\EventDispatcher\ServiceEventListener->__invoke() - /var/www/vhosts/example.com/owncloud.example.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() - /var/www/vhosts/example.com/owncloud.example.com/lib/private/EventDispatcher/EventDispatcher.php line 87
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 404
OC\EventDispatcher\EventDispatcher->dispatch() - /var/www/vhosts/example.com/owncloud.example.com/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php line 236
OCA\Mail\Service\Sync\ImapToDbSynchronizer->runPartialSync() - /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 ***") - /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 ***") - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/Job.php line 78
OCA\Mail\BackgroundJob\SyncJob->run() - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 103
OCP\BackgroundJob\Job->start() - /var/www/vhosts/example.com/owncloud.example.com/lib/public/BackgroundJob/TimedJob.php line 93
OCP\BackgroundJob\TimedJob->start() - /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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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