Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError thrown by cron background job #8813

Open
BMerz opened this issue Aug 25, 2023 · 9 comments · Fixed by #9359 · May be fixed by #9433
Open

TypeError thrown by cron background job #8813

BMerz opened this issue Aug 25, 2023 · 9 comments · Fixed by #9359 · May be fixed by #9433
Assignees

Comments

@BMerz
Copy link
Contributor

BMerz commented Aug 25, 2023

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

@ChristophWurst
Copy link
Member

Can confirm. @hamza221 could you have a look?

@hamza221 hamza221 self-assigned this Oct 11, 2023
@BMerz
Copy link
Contributor Author

BMerz commented Dec 14, 2023

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

@BMerz
Copy link
Contributor Author

BMerz commented Dec 28, 2023

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

@hamza221
Copy link
Contributor

This Happens when

$status['messages'],

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 ?

@ChristophWurst
Copy link
Member

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.

@WeskerC
Copy link

WeskerC commented Feb 19, 2024

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

@WeskerC
Copy link

WeskerC commented Feb 22, 2024

I copy the new php file and new bugs occur. @ChristophWurst
Below are the log details.
’其他文件夹‘ means Other Folder.
image

@hamza221 hamza221 reopened this Feb 22, 2024
@hamza221 hamza221 linked a pull request Mar 5, 2024 that will close this issue
@risto42

This comment was marked as duplicate.

@ChristophWurst

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📄 To do
5 participants