Troubleshooting

The purpose of this section in the documentation is to guide users through essential checkpoints to consider when encountering any issues during the report generation process with Smart Report Engine. Additionally, we will explore Smart Report Engine's logging feature, which assists in troubleshooting potential problems that may arise in the generated reports.

1. Verifying Read/Write Permissions

When generating a new report with Smart Report Engine, it is crucial to ensure that the system has the necessary read/write permission (755 in Linux) for the `/sre_reports` directory. This permission allows the system to create a configuration file for the report and store the selected report options within it. The system automatically places each report's configuration file in a subdirectory under `/sre_reports`, following this format: `/sre_reports/your_new_report/config.php`.

To avoid permission errors, it is essential to verify the permission settings for the Apache user in the `/sre_reports` directory. To identify the Apache user on a Linux system, use the following command:

 							

    ps -ef | grep apache  				
							

Verify that the Apache user has the required permissions for the `/sre_reports` directory using the following command:

 							

   ls -l /sre_reports 				
							

The output will display the directory's permissions, owner, group, and other details. Ensure that the Apache user has read (r), write (w), and execute (x) permissions (755) for the directory. If the permissions need adjustment, use the `chmod` command accordingly. Please exercise caution when modifying permissions to maintain security.


2. Ensuring Accurate Paths

It is crucial to ensure the correct import of Smart Report Engine's namespaces and the proper inclusion of the autoloading script while requiring it. Smart Report Engine offers two installation modes. If you download it manually (without using Composer), the autoloading script is named "sre_bootstrap.php" and can be located in the root of the downloaded package. When utilizing the `require` or `require_once` statement, ensure you provide the accurate path to this script for smooth functionality.

3. Verifying Execute Permissions

On occasions, users might come across problems not stemming from inadequate read/write permission, as noted in Point 1, but rather from the absence of execute permission in some or all PHP files of Smart Report Engine. Ensuring that the necessary files have the appropriate execute permission is essential to avoid any potential challenges during the system's operation.

4. Ensuring a Valid Connection String and Valid SQL Permissions

To ensure smooth functioning, it is essential to validate the correctness of the MySQL username, password, server, and database name in the corresponding fields within the configuration file located at `/sre_config/config.php`.

Moreover, confirm that the MySQL user used in the configuration has the necessary "Select" permission on the database tables. "Select" permission is sufficient for the system to operate effectively.

If you intend to run the examples provided in the community edition, import the SQL file included with this version. Once imported, use the connection string of the imported database to ensure seamless execution of the examples.

5. Enable Logging for Report Issues

Smart Report Engine offers a beneficial logging feature that facilitates the identification of issues in generated reports. By activating this feature, you can promptly diagnose any potential problems that may occur. The logging functionality can be enabled for individual reports or applied globally to all reports.

5-1 Enabling the Logging Feature Globally for All Generated Reports
  • Locate and open the `/sre_reports/shared/config/general_config.php` file with your preferred text editor.
  • Inside `general_config.php`, you can control the general settings for all reports, including `$general_maintenance_mode` and `$general_maintenance_log_path`. Change `$general_maintenance_mode` from the default value of False to True. Additionally, specify the relative path to a secure, non-publicly accessible directory in `$general_maintenance_log_path`, where the log files will be stored. In the subsequent steps, we will refer to this directory as the "log directory."
  • Access the report experiencing issues through your web browser by visiting its URL.
  • Revisit the log directory. You should find a log file with the format "your_report_name_log," containing the precise error message.
  • To disable the logging feature, revert `$general_maintenance_mode` (located in the `general_config.php` file) back to False. Alternatively, logs will continue to be saved in the log directory. Avoid using a publicly accessed log directory.
5-2 Enabling the logging feature for a specific report
  • Find and open the configuration file of the specific report for which you wish to enable the logging feature. This file can be located at `/sre_reports/your_generated_report/config.php`.
  • Inside `config.php`, you can manage the report settings, including `$maintenance_email`, `$maintenance_mode`, and `$maintenance_log_path`. Change `$maintenance_mode` from the default value of False to True. Additionally, if you prefer to store logs in log files, provide the relative path to a secure, non-publicly accessible directory in `$maintenance_log_path`, where the log files will be saved. For simplicity, we will refer to this directory as the "log directory." If you want to receive logs by email, add your email address to `$maintenance_email`.
  • Access the report experiencing issues through your web browser by visiting its URL.
  • If you enabled log files, check the log directory. You should find a log file with the format "your_report_name_log," containing the precise error message.
  • If you opted to receive logs via email, check your email address for the logs.
  • To disable the logging feature, revert `$maintenance_mode` (located in the `general_config.php` file) back to False. Alternatively, logs will continue to be saved in the log directory. Ensure not to use a publicly accessed log directory. Also, please remove your email address from `$maintenance_email` unless you want the logs to be consistently sent to your email address.