mail
mail copied to clipboard
TypeError thrown by cron background job
Steps to reproduce
Open nextcloud log error message is shown
[mail] Fehler: TypeError: OCA\Mail\IMAP\MailboxStats::__construct(): Argument #1 ($total) must be of type int, null given, called in /var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php on line 147 at <<closure>>
0. /var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php line 147
OCA\Mail\IMAP\MailboxStats->__construct()
1. /var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php line 294
OCA\Mail\IMAP\FolderMapper->getFoldersStatusAsObject()
2. /var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php line 145
OCA\Mail\IMAP\MailboxSync->syncMailboxStatus("*** sensitive parameters replaced ***")
3. /var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php line 110
OCA\Mail\IMAP\MailboxSync->sync("*** sensitive parameters replaced ***")
4. /var/www/nextcloud/lib/public/BackgroundJob/Job.php line 81
OCA\Mail\BackgroundJob\SyncJob->run()
5. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 103
OCP\BackgroundJob\Job->start()
6. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 93
OCP\BackgroundJob\TimedJob->start()
7. /var/www/nextcloud/cron.php line 152
OCP\BackgroundJob\TimedJob->execute()
at 2023-08-25T18:05:07+00:00
message is shown around 14 times per day
Expected behavior
no error message is shown or a hint why this error occurs
Actual behavior
error message is shown with unknown reason
Mail app version
3.3.1
Mailserver or service
imap on debian
Operating system
Raspbian bullseye 64bit (Linux 6.1.21-v8+ aarch64)
PHP engine version
PHP 8.1
Web server
Nginx
Database
MariaDB
Additional info
No response
Can confirm. @hamza221 could you have a look?
@hamza221 : Any news on this? Still having the issue.
Hi @ChristophWurst , hamza221 seems not to be active on this issue. Log entries still exist in the log.
This Happens when https://github.com/nextcloud/mail/blob/9046906d779f82ec2218dc3935187d8430c6d194/lib/IMAP/FolderMapper.php#L146
Is not returned from the IMAP server,
We can fix this by manually throwing an exception before instantiating MailboxStats
to have better logs. what do you think @ChristophWurst ?
We should check if the IMAP RFC for the STATUS command dictates returning a value or if it's optional. If it should be there's we can think about throwing. Else we make our app handle null values.
same issue here.
Wish the issue will be resolved soon.
Thank you for your work @ChristophWurst ,greatly appreciated.
I copy the new php file and new bugs occur. @ChristophWurst
Below are the log details.
βε
Άδ»ζδ»Άε€Ήβ means Other Folder.
Also bit by this.
@risto42 we are aware. Add your :+1: to https://github.com/nextcloud/mail/issues/8813#issue-1867586645. A comment is not necessary.