SugarCRM SupportKnowledge BaseTroubleshootingTroubleshooting Blank Pages and Partial Page Loads

Troubleshooting Blank Pages and Partial Page Loads

Overview

Occasionally, you may encounter an error or unexpected behavior in Sugar® such as the page not loading properly. This article will go over some high-level troubleshooting tips based on common symptoms.

Symptoms

While navigating through Sugar, the application returns a blank page or portions of the page (e.g. the footer) fail to load.

Resolution

JavaScript Troubleshooting Steps

You can check for errors in the browser's console window. Sugar uses a large amount of JavaScript, and JavaScript errors do not write to your typical logs, but do write to the browser's console. If you are accessing Sugar using either the Chrome or Firefox browser, please right-click anywhere on the page, select "Inspect Element", then click the Console tab.

For Chrome:
Chrome ConsoleTab

For Firefox:
Firefox Console2

For SugarCloud instances, include any JavaScript errors when filing a case with the Sugar Support team for assistance.

For on-site instances, errors detected in the browser's console can be addressed as follows:

  1. If the file mentioned in the error is located inside the ./cache/ directory, temporarily move or rename the file. Sugar will automatically rebuild these files if and when it is needed.
    • Test to see if the page loads properly in Sugar.
    • After testing, if the file is not automatically rebuilt and renaming the file had no visible effect on the issue, restore the file in the ./cache/ directory.
  2. If the file is not located inside the ./cache/ directory, open the file in a text editor or IDE (e.g. Sublime Text, WordPad++, and Eclipse).
    • Examine the line number in the source file referenced in the error message.
    • If any changes are made, please save the file, then navigate to Admin > Repair and perform "Repair JS" to rebuild your JavaScript. Test to see if the page loads properly again.

For more information on JavaScript repairs in Sugar, please refer to the Repair documentation.

If the errors reference another file, please follow the instructions above in Step 5 of the PHP Log Troubleshooting Steps section below. 

PHP Log Troubleshooting Steps

SugarCloud customers can file a case with the Sugar Support team for assistance since the PHP error logs are not accessible for SugarCloud instances.

Note: Beginning with version 9.1.0, SugarCloud customers can generate PHP error logs from the SugarCloud Insights page.

On-Site customers should contact their system administrator to check the PHP error logs. The error log configuration is specified in the PHP configuration file, php.ini. System administrators should investigate for any PHP errors that could be causing the page to not load properly in Sugar.

The following steps cover troubleshooting methods that on-site system administrators can take, assuming some familiarity with PHP, but will only cover common and relatively simpler symptoms.

  1. If errors are not being logged or displayed on the page, verify the following in the PHP configuration file, php.ini:

    • display_errors is enabled (Note: This should only be enabled while actively troubleshooting.)
      OR
    • log_errors is enabled and, if you wish PHP errors to be written outside of the server log, error_log is set to a valid path and file

    In either case, error_reporting should be set to E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED. Be sure to restart PHP after saving any changes to the PHP configuration file. For more information on PHP error handling, please refer to PHP Error Handling Configuration and PHP Error Handling Constants.

    Note: If you do not have access to your php.ini file but have access to your index.php file in the instance's DocumentRoot, add the following lines to line 2 of the index.php file:
    error_reporting(E_ALL);
    ini_set('display_errors', 'On'); 
    Note: These lines should be removed from index.php when you are not actively troubleshooting.
  2. Look for fatal compile-time or run-time errors generating when the blank or partial page load occurs. The errors should indicate a file and line number where the error(s) occurred.
  3. If the file mentioned in the error is located inside the ./cache/ directory, temporarily move or rename the file. Sugar will automatically rebuild these files if and when it is needed.
    • Test to see if the page loads properly in Sugar.
    • After testing, if the file is not automatically rebuilt and renaming the file had no visible effect on the issue, restore the file in the ./cache/ directory.
  4. If the file is not located inside the ./cache/ directory or Step 3 did not resolve the issue, open the file in a text editor or IDE (e.g. Sublime Text, WordPad++, and Eclipse).
    • Examine the line of code preceding the line number of the error and verify its syntax. Also, verify that any data structure definitions containing this line of code and the line of the error are also free from any syntax or logical errors.
    • If any code changes are made, save the file and test to see if the page loads properly again.
  5. If the code generating the error references another file, check to see if the referenced file exists and has the appropriate permissions for the web server user. For more information on SugarCRM application file permissions, please refer to the Required File System Permissions on Linux or Required File System Permissions on Windows With IIS articles.
    • If the file is missing, compare a stock instance of the same version of Sugar and see if the file exists there.
    • If the file exists in the stock instance, copy the file from stock and test the issue again.

    To ensure that your permissions are set properly in a Unix-based server (Linux or Mac), please add the following lines:

    sudo chown -R  {webuser}:{webgroup} *
    sudo find . -type d -exec chmod 775 {} \;
    sudo find . -type f -exec chmod 664 {} \;

    Please note that the web server user (webuser) and group (webgroup) values can vary depending on your web server configuration. If you are using a Red Hat-based Linux (e.g. Red Hat, Fedora Core, and CentOS), you will replace the web server user and group with apache. However, if you are using a Debian-based Linux distribution (e.g. Debian, Ubuntu, and Linux Mint), you will replace the web server user and group with www-data

DanG

Last modified: 2019-08-01 18:20:38