You may encounter some common problems and errors that can occur when running the WHASOLS cron job.

For more information about troubleshooting cron job issues

Troubleshooting
There are several techniques available for troubleshooting the problems that you may encounter with the cron job:

Cron Execution
If you do not receive the daily cron digest email, see a warning on the System Health Status overview page, or on the Automation Status page then this indicates the cron not running. Troubleshooting and resolving this is a matter of priority, as the daily automation tasks are an integral part of WHASOLS.

Detailed steps on how to debug the cron execution can be found in our Cron Troubleshooting Guide.

Run the cron job in your browser
To do this:

  1. In the WHASOLS admin area, go to the Other tab at Configuration  > General Settings.
  2. Enable the Display Errors option.
  3. Enable Cron Execution via browser
  4. Visit the cron url in your browser.
For example: https://example.com/cron.php

Note
Executing cron from a web browser have subject to limitations that apply to executing any PHP script via a web browser such as, timeouts and won't provide any output on screen to examine (the execution must be observed from the Activity Log). Where possible, executing cron from your server's command line interface is the recommended troubleshooting method.

Run the cron job from the server command line

To do this:

  1. Access your server's command line.
  2. Copy the cron job command for the cron.php file from your server's cron tab.
  3. crontab -u userName -l
    Where userName represents the user on the server for which the cron command is configured under.
  4. Execute the command you copied with the addition of the verbose option:
  5. php -q /home/your-domain-directory-name/cron.php >/dev/null 2>&1 -vvv
  6. Examine the output for any errors.
  7. To execute all daily automation tasks, adjust the cron command again to add in the force option:
  8. php -q /home/your-domain-directory-name/cron.php >/dev/null 2>&1 --force -vvv
    This should only ever be executed once in any 24 hour period. Do this with the explicit intention of identifying why the cron may not be completing successfully.
    For more information, see Cron Commands.

Run the cron job from the server command line with debugging enabled
To do this:

  • Make sure you have enabled Display Errors in the Other tab at Configuration > General Settings.
  • Access your server's command line.
  • Make sure you have enabled display_errors in your command line PHP environment:
php -i | grep display_errors
display_errors => STDOUT => STDOUT
  • Copy the cron job command for the cron url from your server's crontab:
crontab -u userName -l
  • Add the --force option to the end of the cron command and execute it:
php -q /home/your-domain-directory-name/cron.php >/dev/null 2>&1 all --force -vvv
  • Examine the output for any errors. The final line output should be "[OK] Completed".
Common Errors
Site error: the  cron url requires the Latest Version of ionCube PHP Loader  to be installed by the website operator
Seeing this error output indicates that the PHP configuration for your WHASOLS installation may be different than the one on the command line.

Log in as the same user that the cron job runs under. Then, run the following command at the server's command line to see the version information for your PHP and ionCube Loader® configuration:

php -v
You should get an output along the lines of:

PHP 7.4.28 (cli) (built: Mar 17 2022 01:06:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.


If the "with the ionCube PHP Loader" line is absent, this indicates that the ionCube loaders are not available for this user. Work with your hosting provider or server administrator to ensure that the ionCube loaders are available to the cron job user.

Oops! Something went wrong and we couldn't process your request
This indicates that a fatal PHP error has occurred. Go to the Other tab at Configuration > General Settings. Select 'Display Errors'. Then, run the cron job again. The system will display the full error. The error normally indicates an issue with one or more modules.

For example, you could see:

exception 'ErrorException' with message 'Cannot redeclare class module_class' in /home/username/public_html/modules/gateways/module-name/module-file.php:21
If the error references a third party module you are using, you will need to contact the developers of the module to review and resolve the error. If the error references a WHASOLS-developed and shipped module, contact our Support Team. It may also indicate an issue with the PHP configuration. For more information, see the sections below.

Fatal error: Allowed memory size of 21564129 bytes exhausted (tried to allocate 20480 bytes)
This error indicates that the system is terminating the cron job because it has exceeded the 'memory_limit' value of 32 MB. Increase this to 64 MB (128 MB if possible) to resolve this. Contact your server administrator or hosting provider for assistance with this.

You can check the limit using this command:

php -ini | grep "memory_limit"
The file https://example.com/crons is corrupted
You may see this error in version 1.0 and above. This error will occur if you are running ionCube Loader version 10.0 or earlier. WHASOLS 1.1 requires ionCube Loaders 10.1.0 or above. If your WHASOLS installation is working, it indicates that the PHP configuration for your WHASOLS installation may be different than the one that you use on the command line. To check this, you can again use the command below:

php -v
Look for the following line to identify the ionCube Loader version:

with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.0, Copyright 
(c) 2002-2018, by ionCube Ltd.
Error: Call to undefined function curl_init()
This error indicates that the system is terminating the cron job because the 'curl' extension is missing. To check this, run the following command:

php -m
A similar error may also occur if the 'curl_init' function is a disabled function in your PHP configuration.

\Exception\ErrorException' with message 'Maximum execution time of 30 seconds exceeded
This error indicates that the system is terminating the cron job because it has exceeded the 'max_execution_limit' value of 30 seconds. Increase this to an appropriate value for the size of your installation. For most servers, a limit of '120' is sufficient, but larger servers may need a value of '300'.

You can check the limit using this command:

php -ini | grep "max_execution_time"
Segmentation fault
This error is not directly related to the WHASOLS software and can occur for many different reasons. It most commonly indicates that PHP is crashing and suggests there is an issue with your PHP installation (for example, a malfunctioning extension). It is something your server administrator or hosting provider would need to investigate, possibly using the 'strace' utility.