Each CRON run of scheduled job Check Inbound Mailboxes leads to a PHP Fatal error
Incoming group accounts should be polled for new messages, and cases created for each new message.
I don't have log access on the IMAP server for the incoming account, so I can't verify whether the account is being polled, but previously, each message would be polled and marked as read in the account - this is not happening now. Each run throws the following error in php error.log:
`PHP Fatal error: Uncaught Error: Call to a member function retrieve() on null in /path/to/suitecrm/modules/InboundEmail/AOPInboundEmail.php:71
Stack trace:
thrown in /path/to/suitecrm/modules/InboundEmail/AOPInboundEmail.php on line 71`
suitecrm.log:
Tue Oct 9 13:25:04 2018 [14346][1][ERROR] Pop error level. Try to remove the error_reporting() function from your code.
Tue Oct 9 13:25:04 2018 [14346][1][FATAL] * FOLDERS: addBean() got empty bean - not saving
Tue Oct 9 13:25:04 2018 [14346][1][FATAL] Job a0a49f47-3960-3427-c038-5bbce4a82334 (Check Inbound Mailboxes) failed in CRON run
It seems clear to me that the method AOPInboundEmail->handleCreateCase() is expecting an argument but getting NULL as its first arg, but I haven't gone deeply enough into the code to know. I did have a look at a previous version of this method (used to be in custom/modules) and it seems this most recent version has been refactored somewhat. What success could be had overriding the current version with the older custom/modules module?
We're now unable to auto-create cases from incoming emails
Thanks for any insight you can give!
Issue is caused by PR #6237
Issue is new cases created by Check Inbound Mailbox are not marking the email they are created from as read so Check Inbound Mailbox is trying to create the same case twice and failing.
If the PR is reverted the user will need to find the most recent case that was created by Check Inbound Mailbox then find the corresponding email in the mailbox and mark it as read for the scheduler Check Inbound Mailbox to run correctly again.
I'm running the latest release, 7.10.9. @JackBuchanan Are you saying I would need to install the latest git build, revert the PR, and follow your steps above to fix? Or will this be fixed on the next production release? Our use case depends entirely on auto-generation of cases from email.
By the way, the mailbox in question does not have any unread messages. Is this PR the only vector for this bug?
Thanks for your help.
If there is no unread emails in your mailbox it is possible there might be a different PR causing this issue in your case.
If you don't wish to revert the whole PR removing '$isGroupFolderExists' from if ($aopInboundEmailX->returnImportedEmail($msgNo, $uid, false, true, $isGroupFolderExists)) in modules/Schedulers/_AddJobsHere.php on line 605 should have the same effect as the full PR revert.
Thanks, @JackBuchanan. I've reverted all changes from #6237 and no joy. The error persists.
Any other idea what's causing this?
This should be fixed by #6441
@Dillon-Brown @JackBuchanan I've installed 7.10.10 and can confirm this issue is fixed. Thanks!
Most helpful comment
@Dillon-Brown @JackBuchanan I've installed 7.10.10 and can confirm this issue is fixed. Thanks!