Error "Special mailbox trash does not exist"

Hello,
i have this error all the time in the server log. How do I find out which account is the reason for this error? One user told me that mail does not work, and I saw that the folders ‘sent’ ‘trash’ etc were not properly set, which is weird because I am sure that everything worked correctly before the update from NC19 to 20.0.4 (Mail app 1.7.2). I fixed this already and the error still appears.

Or any other ideas?

Thank you =)

OCP\AppFramework\Db\DoesNotExistException: Special mailbox trash does not exist

{“reqId”:“3h2Pen1dFMy4rgcyCABB”,“level”:3,“time”:“2021-01-06T17:06:44+01:00”,“remoteAddr”:"",“user”:"–",“app”:“mail”,“method”:"",“url”:"–",“message”:{“Exception”:“OCP\AppFramework\Db\DoesNotExistException”,“Message”:“Special mailbox trash does not exist”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/mail/lib/Listener/MailboxesSynchronizedSpecialMailboxesUpdater.php",“line”:82,“function”:“findSpecial”,“class”:“OCA\Mail\Listener\MailboxesSynchronizedSpecialMailboxesUpdater”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",“line”:76,“function”:“handle”,“class”:“OCA\Mail\Listener\MailboxesSynchronizedSpecialMailboxesUpdater”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",“line”:251,“function”:"__invoke",“class”:“OC\EventDispatcher\ServiceEventListener”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",“line”:73,“function”:“callListeners”,“class”:“Symfony\Component\EventDispatcher\EventDispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",“line”:86,“function”:“dispatch”,“class”:“Symfony\Component\EventDispatcher\EventDispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",“line”:98,“function”:“dispatch”,“class”:“OC\EventDispatcher\EventDispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php",“line”:125,“function”:“dispatchTyped”,“class”:“OC\EventDispatcher\EventDispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php",“line”:91,“function”:“sync”,“class”:“OCA\Mail\IMAP\MailboxSync”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/public/BackgroundJob/Job.php",“line”:80,“function”:“run”,“class”:“OCA\Mail\BackgroundJob\SyncJob”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",“line”:61,“function”:“execute”,“class”:“OCP\BackgroundJob\Job”,“type”:"->"},{“file”:"/var/www/nextcloud/cron.php",“line”:127,“function”:“execute”,“class”:“OCP\BackgroundJob\TimedJob”,“type”:"->"}],“File”:"/var/www/nextcloud/apps/mail/lib/Listener/MailboxesSynchronizedSpecialMailboxesUpdater.php",“Line”:120,“CustomMessage”:“Cron mail sync failed: Special mailbox trash does not exist”},“userAgent”:"–",“version”:“20.0.4.0”,“id”:“5ff5e432be341”}

do you have a trash mailbox? just so I know if the logic that should detect that mailbox failed or if you simply don’t have a matching mailbox in your account

There are around 15 NCaccounts which have an Emailaccount linked in the Mail App. They should (!) all have a trash folder.

There is no way to find out which NCaccount is causing this problem?

Try enabling argument traces and if you’re lucky we find the account/mailbox ID from the trace

More info at PHP: Other Changes - Manual