How to fix cron readiness check issues in Magento 2

- E-Commerce, Magento 2

Magento 2 export CLI

If you experience issues with cron readiness in Magento 2, the following article may be helpful. We describe several symptoms of the “ailment” and shed light on how to fix the problem. More useful tips are gathered in our Cookbook


The issue

Cron issues usually have several symptoms. Firstly, you may spot an error message about $HTTP_RAW_POST_DATA, even though this PHP setting is set correctly. Secondly, no PHP version is displayed at the PHP readiness check. Thirdly, you may see an error message in the admin, informing you about invalid indexers and proposing to check whether Magento cron job is running. 

The solution

To fix the problem, you have to check whether cron is currently running or not. At the same time, it is necessary to see if it’s set up correctly. To do both tasks, you have to log in as a Magento file system owner to your Magento 2 server. If the following file exists, cron has already run successfully:

If you cannot find this file, it means that you haven’t yet installed Magento. If it is installed, cron isn’t running. 

Now, you have to get more detail about cron. Use the following command (you should have root privileges to do that): 

The system will inform you if there is no crontab for the user. As for the crontab, it provides the following information:

  1. PHP binary(s).
  2. Magento cron scripts and paths to them;
  3. Location of cron logs.

Set up crontab

You have to set up your Magento 2 crontab if it is not configured correctly. See the official Magento documentation to verify whether it suits the requirements or not: Set up cron jobs. If it is not set up correctly, follow the instructions in the official guide.

Correct PHP binary

Chances are your cron job uses an inappropriate PHP binary. If the binary differs from the web server plug-in, it may lead to PHP settings errors. 

Note that PHP settings for both the PHP command line and the PHP web server plug-in should be identical! See the official Magento 2 documentation: Required PHP settings.

Discover cron errors

To discover more information about cron readiness check issues in Magento 2, run cron commands manually. Run cron at least twice per job: to queue it and then to execute. Note that commands might display helpful error messages that shed light upon the existing cron issues. See the official documentation we’ve just mentioned: Set up cron jobs.

For further information, follow this link: cron readiness check issues.