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!

1 Like

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>

Problem still exists in 8.7.1.

Turned on debug logging, set logging level to debug and turned on stack trace and white-screen-of-death.

index.php generated a 500 error with this line in config_override.php so removed it (tried it from comment above)

$sugar_config[ā€˜logger’][ā€˜level’] = ā€˜debug’;

Went into config.php and turned off debug mode and went into config_override.php and set log mode back to ā€œfatalā€ and it started working again.

HAD TO GO INTO BROWSER ā€œDEVELOPER TOOLSā€ and turn off CACHEING to make sure it cleared everything.

Hi @ddbmonsoon , welcome to the Community! :tada:

Your text is using smart quotes like ā€˜debug’ instead of straight quotes like 'debug'.

Maybe that’s just the way it turned out here in the forums when you posted it, but please make sure that it is correct in your config.php.

THAT IS AWESOME information… I didn’t realize… I copied it from the post above (here) and didn’t type it myself. I just looked at it using smart quotes in the link I just shared with you. Thank you so much!!

1 Like