Undefined index: HEADERSYNC

Hello everyone. I’ve recently encountered an issue with our SuiteCRM installation that I was hoping someone could shed some light on. When trying to access the login page, I get the following stack trace error:


: Undefined index: HEADERSYNC occurred in /opt/bitnami/apps/suitecrm/htdocs/cache/smarty/templates_c/%%79^79D^79D9896D%%displayLoginJS.tpl.php on line 27 [2019-04-25 12:17:56] display_stack_trace caller, file: /opt/bitnami/apps/suitecrm/htdocs/include/utils.php line#: 3543
/opt/bitnami/apps/suitecrm/htdocs/cache/smarty/templates_c/%%79^79D^79D9896D%%displayLoginJS.tpl.php[L:27](:StackTraceErrorHandler)
/opt/bitnami/apps/suitecrm/htdocs/include/Smarty/Smarty.class.php[L:1270](:include)
/opt/bitnami/apps/suitecrm/htdocs/include/Sugar_Smarty.php[L:158](Smarty:fetch)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/View/SugarView.php[L:872](Sugar_Smarty:fetch)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/View/SugarView.php[L:1260](SugarView:_displayLoginJS)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/View/SugarView.php[L:409](SugarView:renderJavascript)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/View/SugarView.php[L:199](SugarView:displayHeader)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/Controller/SugarController.php[L:432](SugarView:process)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/Controller/SugarController.php[L:375](SugarController:processView)
/opt/bitnami/apps/suitecrm/htdocs/include/MVC/SugarApplication.php[L:109](SugarController:execute)
/opt/bitnami/apps/suitecrm/htdocs/index.php[L:51](SugarApplication:execute)

I’ve been doing some digging through the code of the stack trace and found that the SugarView.php file is supposed to set the headersync variable to point to a file called modules/Sync/headersync.js, which does not exist on my server. Any ideas? Thanks!

Hi firebee1991,

I’d suggest turning off PHP notices in your php.ini and restarting the server. E.g.

change error_reporting E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED to error_reporting(0);

I can, of course, look into and fix this notice but I’d recommend simply turning off the error reporting as most of these notices won’t actually affect the functionality and SuiteCRM can output dozens of notices on a single page.

Hi Dillon,

Thanks for your help. I edited /opt/bitnami/php/etc/php.ini, changed the error_reporting line as you suggested, and restarted, but I’m still running into the same error. On Google’s advice, I had also previously changed the display_errors to Off.

Thanks again,
Ryan

I manged to figure this out so I figured I’d post the solution in case someone else runs into the same problem. I copied over the config.php and config_override.php files from another working instance and that fixed it. I ran a diff on the two files to see the difference and there was very little, the only two things that were different were that the ‘level’ => ‘info’, was set to ‘level’ => ‘debug’, and the js_lang_version was set to 3 instead of 4. Changed those two things and it came right back up.