Error 500 during saving email settings

We have a on premise environment that is running on SE Linux, PHP version 7.3.27 with mysql version 5.7.28. We upgraded the instance to the latest on premise version (10.0.4). All seems to be working as I would expect except one thing:

For some reason when I open a user profile ( users module ) we receive an error 500 and in the logs it states the following:

[Fri Apr 09 13:29:49.897344 2021] [php7:warn] [pid 32101] [client 10.116.11.8:52072] PHP Warning: Invalid argument supplied for foreach() in /appl/www/<sugarpath>/htdocs/modules/EmailMan/views/view.config.php on line 195, referer: https://<sugarpath>/index.php?module=Administration&action=index&bwcFrame=1

So I checked the e-mail settings and these are indeed not filled in. I tried to fill them in but when I try to save these settings I do get an 500 error again and get the following error in the apache error log:

[Fri Apr 09 13:30:18.695248 2021] [php7:error] [pid 8897] [client 10.116.11.8:52075] PHP Fatal error: Uncaught Error: Call to a member function populateFromPost() on null in /appl/www/<sugarpath>/htdocs/modules/EmailMan/controller.php:36\nStack trace:\n#0 /appl/www/<sugarpath>/htdocs/include/MVC/Controller/SugarController.php(448): EmailManController->action_Save()\n#1 /appl/www/<sugarpath>/htdocs/include/MVC/Controller/SugarController.php(421): SugarController->do_action()\n#2 /appl/www/<sugarpath>/htdocs/include/MVC/Controller/SugarController.php(396): SugarController->handle_action()\n#3 /appl/www/<sugarpath>/htdocs/include/MVC/Controller/SugarController.php(304): SugarController->process()\n#4 /appl/www/<sugarpath>/htdocs/include/MVC/SugarApplication.php(199): SugarController->execute()\n#5 /appl/www/<sugarpath>/htdocs/index.php(27): SugarApplication->execute()\n#6 {main}\n thrown in /appl/www/<sugarpath>/htdocs/modules/EmailMan/controller.php on line 36, referer: https://<sugarpath>/index.php?module=EmailMan&action=config

is there someone who noticed same behaviour during upgrades?

  • Jeroen,

    I have indeed noticed some oddities in the 10.0.4 release. The main thing I noticed on upgrading was the fact that the TinyMCE editor is missing from the EmailTemplate module (the standard one, not the BPM one) so it is no longer possible to edit or create HTML email templates there.

    I suspect your issues, being also in the Email sphere, are possibly related as well.

    My initial investigations led me to see that there are a number of files and directories missing from the Emails module in the 10.0.4 version. Specifically I noticed that the "./modules/Emails/javascript" directory has been removed. I believe it is this omission that is causing my issue as the javascript that actions the editor is in that directory and I suspect that your issues may lie in a similar area. I would have a check in the code base and see what exists in that module and try to trace your issues and see if that is a cause.

    I have just checked (5 minutes ago) that the current 10.0.4 on the download manager is still missing those items from the Emails module. I have been unable (due to time constraints) to establish whether these files and directories have been removed on purpose (10.0.4 is a security release with a need to install ASAP according to SugarCRM) or by accident. It is not clear to me from the release notes that removing these items, and the TinyMCE editor, is to fix any of the specific issues mentioned.

    For now, we have rolled back to 10.0.3 and it will stay that way until we can be confident the missing functionality is supposed to be missing. Even then, we will not upgrade until it is replaced with a likewise functionality as our customers rely on being able to create Email Templates in the HTML editor for campaigns.

    Lastly, I have managed to test all paths to upgrade, 9.0.x - 10.0.4, 9.0.x - 10.0.3 - 10.0.4, fresh install directly of 10.0.4 and all end up with the same issue. In fact an upgrade from 9.0.x to 9.0.6 also causes these items to be removed from the code tree so it is the security release patch (that applies to 9.0.6 as well as 10.0.4) itself that is affected.

    Sorry this isn't more help Disappointed

    JH.

  • From modules/EmailMan/controller.php we have:

                $oe = $oe->getSystemMailerSettings();
                $oe->populateFromPost();
    

    I believe that the issue is at $oe->getSystemMailerSettings(), once this method returns null|OutboundEmail. It returns null if method retrieve from SugarBean returns null as well.

    So you need to debug the array returned by $this->getSystemMailData(); and conditions to SugarBean returns null in method retrieve.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • I eventually created a support ticket. The 'solution' for this particular instance was to remove all the entries in the outbound_email table. I checked beforehand it's contents and noticed that everything was set deleted = 1 so it didn't have any impact from that point of view. After deleting all the entries I could save the e-mail settings again and the error was gone.