mail icon indicating copy to clipboard operation
mail copied to clipboard

TypeError thrown by cron background job

Open BMerz opened this issue 1 year ago β€’ 9 comments

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

BMerz avatar Aug 25 '23 19:08 BMerz

Can confirm. @hamza221 could you have a look?

ChristophWurst avatar Oct 11 '23 08:10 ChristophWurst

@hamza221 : Any news on this? Still having the issue.

BMerz avatar Dec 14 '23 15:12 BMerz

Hi @ChristophWurst , hamza221 seems not to be active on this issue. Log entries still exist in the log.

BMerz avatar Dec 28 '23 13:12 BMerz

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 ?

hamza221 avatar Dec 29 '23 15:12 hamza221

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.

ChristophWurst avatar Dec 29 '23 15:12 ChristophWurst

same issue here. image Wish the issue will be resolved soon. Thank you for your work @ChristophWurst ,greatly appreciated.

WeskerC avatar Feb 19 '24 16:02 WeskerC

I copy the new php file and new bugs occur. @ChristophWurst Below are the log details. β€™ε…Άδ»–ζ–‡δ»Άε€Ήβ€˜ means Other Folder. image

WeskerC avatar Feb 22 '24 12:02 WeskerC

Also bit by this.

risto42 avatar Mar 20 '24 10:03 risto42

@risto42 we are aware. Add your :+1: to https://github.com/nextcloud/mail/issues/8813#issue-1867586645. A comment is not necessary.

ChristophWurst avatar Mar 20 '24 10:03 ChristophWurst