Debug on - everything now blank

Apologies for the lack of info but because I now get a completely blank page I cannot click through to review what I actually didā€¦!

In a nutshell, I was in the settings page (where you can increase max. import records) and I scrolled down and saw I could tweak error reporting. I set something to debug, perhaps something else also (canā€™t remember) and after that now nothing works and I get a blank page.

From apache log:

[Fri Aug 30 01:10:06.563696 2024] [php:error] [pid 588843] [client 1.65.183.146:50588] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function StackTraceErrorHandler(), 4 passed in /var/www/sites/ImperialCRM/include/SugarLogger/SugarLogger.php on line 239 and exactly 5 expected in /var/www/sites/ImperialCRM/include/utils.php:3800\nStack trace:\n#0 /var/www/sites/ImperialCRM/include/SugarLogger/SugarLogger.php(239): StackTraceErrorHandler()\n#1 /var/www/sites/ImperialCRM/include/SugarLogger/LoggerManager.php(142): SugarLogger->log()\n#2 /var/www/sites/ImperialCRM/include/utils/LogicHook.php(191): LoggerManager->__call()\n#3 /var/www/sites/ImperialCRM/include/utils.php(3608): LogicHook->call_custom_logic()\n#4 [internal function]: sugar_cleanup()\n#5 {main}\n thrown in /var/www/sites/ImperialCRM/include/utils.php on line 3800

Nothing appears in suitecrm.log - it doesnā€™t even get that far.

Any ideas? Can I ā€œundoā€ the configuration change somehowā€¦ would it be somewhere in the MySQL tables or in a config file?

This is SuiteCRM 7.14.5

Thanks.

ā€¦ never mind, Iā€™ve answered my own question now and found the configuration file as config_override.php

What I had turned on was Log Level ā†’ Debug and I ticked ā€˜Display stack trace of errorsā€™ (but did not enable stack trace, perhaps this is why?).

Didnā€™t know what these did to be fair and I shouldnā€™t play around, but then one doesnā€™t expect it to break as a result. Bug in SugarLogger.php?

Please check what level of log you have in your instance. You might need to use ā€˜Debugā€™ for your purpose.
admin ā†’ system settings

image

OR
Create a file in root folder of instance named ā€˜config_override.phpā€™
add following line
$sugar_config[ā€˜loggerā€™][ā€˜levelā€™] = ā€˜debugā€™;

Thanksā€¦ except thatā€™s what broke my system it seems (or perhaps it was that other tickbox).

(per my reply just above).

Thanks for your thoughts though!

1 Like

But I guess it is set to Fatal as default.

This is a bug, it shouldnā€™t crash the entire app when the debug settings are not perfectly as expected, it should still work and run by a default fallback debug mode that still runs, and log a warning message in the log saying the debug setting isnā€™t right and say itā€™s running in a fallback debug mode.

Indeed. Does this need to be reported as such somewhere?

I can confirm that itā€™s from the ā€œDisplay stack trace of errorsā€ selection, not from setting Log Level to Debug.

It doesnā€™t seem to be a bug here.

Everything is just working fine on 7.14.1 here.

Maybe itā€™s a combination of things.
There is something else, which throws an error and that error handling is somehow broken.
So it would be best to find that something else.

Letā€™s look into your server, maybe itā€™s related to that one.
LAMP matching the Compatibility Matrix?
VHost and permissions are correct?

Other than that: Do you have any custom code?

No problem to ā€œEnable stack traceā€ ā€¦ but once I enable ā€œDisplay stack trace of errors:ā€ I can immediately reproduce the problemā€¦ which I can fix by removing the offending line from config_override.php afterwards.

(Irrespective of whether Enable stack trace is selected)

Permissions set as per installation instructions and everything else works (so far). Compatibility matrix also fine (PHP 8.2 now).

No custom code

Ah, ok - now I can replicate it as well.

display_errors Off

But still, it shows a ā€œwhite screen of deathā€.
Odd enough, there is nothing in the suitecrm.log at that particular point of time after login.

Not sure where it comes from, Iā€™ve not used the stack trace setting in a while.
Maybe itā€™s related to an issue with sessions and header - just a guess without digging deeper.
Maybe itā€™s just a very old residue of an early Sugar version and hasnā€™t been tested for quite a while.

ā€œStack traceā€ is a very unthankful keyword to search for in tech issues :smiley:

Maybe itā€™s not yet reported?

Your initial issue is sovled then?

Initial problem resolved - many thanks. Will steer away from the stack strace!!

Iā€™ve not reported as a bug; havenā€™t had time yet to search if it exists and donā€™t wish to duplicate.

But happy to do so once I have a spare moment!

Iā€™ve seen this error when working on my improved logging PR

Itā€™s true that this requires a fix for the newer PHP versions, see the first red :red_square: warning on this page:

Should be easy to fix by changing this line to

function StackTraceErrorHandler($errno, $errstr, $errfile, $errline, $errcontext = '')

If somebody can please try this and test it (and it works on PHP 8.x) that would be helpful.

Edited utils.php and did QR&R. Then checked :white_check_mark: Display stack trace of errors: in system settings. I got blank page. Then I changed $sugar_config[ā€˜stack_trace_errorsā€™] value to false and reload page. Now, I can see UI. Got this in sugar log.

[FATAL] Catch an error: <b>[Unknown Error (16384)]</b>  Using unregistered function "strpos" in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. occurred in <b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php</b> on line 113 
Trace info:
<font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php</b></font><font color="blue">[L:112]</font><font color="red">(:StackTraceErrorHandler)</font><br><font color="black"><b></b></font><font color="blue">[L:]</font><font color="red">(Smarty_Internal_ErrorHandler:handleError)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php</b></font><font color="blue">[L:113]</font><font color="red">(:trigger_error)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php</b></font><font color="blue">[L:774]</font><font color="red">(Smarty_Internal_Compile_Private_Modifier:compile)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php</b></font><font color="blue">[L:1511]</font><font color="red">(Smarty_Internal_TemplateCompilerBase:callTagCompiler)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php</b></font><font color="blue">[L:564]</font><font color="red">(Smarty_Internal_TemplateCompilerBase:compileTag2)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php</b></font><font color="blue">[L:2420]</font><font color="red">(Smarty_Internal_TemplateCompilerBase:compileTag)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php</b></font><font color="blue">[L:2780]</font><font color="red">(Smarty_Internal_Templateparser:yy_r96)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php</b></font><font color="blue">[L:2875]</font><font color="red">(Smarty_Internal_Templateparser:yy_reduce)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php</b></font><font color="blue">[L:128]</font><font color="red">(Smarty_Internal_Templateparser:doParse)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php</b></font><font color="blue">[L:479]</font><font color="red">(Smarty_Internal_SmartyTemplateCompiler:doCompile)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php</b></font><font color="blue">[L:394]</font><font color="red">(Smarty_Internal_TemplateCompilerBase:compileTemplateSource)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php</b></font><font color="blue">[L:184]</font><font color="red">(Smarty_Internal_TemplateCompilerBase:compileTemplate)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php</b></font><font color="blue">[L:141]</font><font color="red">(Smarty_Template_Compiled:compileTemplateSource)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php</b></font><font color="blue">[L:105]</font><font color="red">(Smarty_Template_Compiled:process)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php</b></font><font color="blue">[L:217]</font><font color="red">(Smarty_Template_Compiled:render)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php</b></font><font color="blue">[L:238]</font><font color="red">(Smarty_Internal_Template:render)</font><br><font color="black"><b>/var/www/html/suitecrm8/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php</b></font><font color="blue">[L:116]</font><font color="red">(Smarty_Internal_TemplateBase:_execute)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/Sugar_Smarty.php</b></font><font color="blue">[L:150]</font><font color="red">(Smarty_Internal_TemplateBase:fetch)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/utils/layout_utils.php</b></font><font color="blue">[L:105]</font><font color="red">(Sugar_Smarty:fetch)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/modules/Administration/index.php</b></font><font color="blue">[L:88]</font><font color="red">(:get_form_header)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/View/SugarView.php</b></font><font color="blue">[L:800]</font><font color="red">(:include_once)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/View/views/view.classic.php</b></font><font color="blue">[L:72]</font><font color="red">(SugarView:includeClassicFile)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/View/SugarView.php</b></font><font color="blue">[L:210]</font><font color="red">(ViewClassic:display)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/Controller/SugarController.php</b></font><font color="blue">[L:432]</font><font color="red">(SugarView:process)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/Controller/SugarController.php</b></font><font color="blue">[L:363]</font><font color="red">(SugarController:processView)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/include/MVC/SugarApplication.php</b></font><font color="blue">[L:101]</font><font color="red">(SugarController:execute)</font><br><font color="black"><b>/var/www/html/suitecrm8/public/legacy/index.php</b></font><font color="blue">[L:52]</font><font color="red">(SugarApplication:execute)</font><br>