Magento – Magento 2.2.3 Cron job won’t run. Status is missed. One is stuck in running. How to fix

cronmagento-cronmagento2

I am having an issue with my Magento 2.2.3 using PHP 7.1 My cron jobs are set as follows:

9,24,38,52 * * * * /usr/local/bin/php /home/website/public_html/update/cron.php >> /home/stebbins/public_html/var/log/update.cron.log

1,25,39,55 * * * * /usr/local/bin/php /home/website/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/stebbins/public_html/var/log/magento.cron.log

0,9,39,49 * * * * /usr/local/bin/php /home/website/public_html/bin/magento setup:cron:run >> /home/stebbins/public_html/var/log/setup.cron.log

When I run the group crons via CLI it says they ran as scheduled, but nearly all appear as status "Missed" and "Too late for schedule". There are also 6 instances of the order export job with status of "running". Please see the screen shots below this message for the cPanel cron settings, cron_schedule table, and Magento admin cron settings.

I think this is due to the crons being "stuck", for lack of a better term and I've been reading the documentation at https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html . I am having a really hard time getting this fixed and I'm spinning my wheels, so, I'm posting here to hopefully get an answer.

  • Should I manually delete all the "running" jobs from the cron_schedule table?
  • Is there a CLI command for Linux for this?
  • Am I just barking up the wrong tree and do you have a better fix?

Thanks so much in advance!

—Screen shots below—

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Best Answer

Should I manually delete all the "running" jobs from the cron_schedule table?

Yes, execute query "delete from cron_scheduled where status = 'running'"

Is there a CLI command for linux for this?

mysql ... -e "delete from cron_scheduled where status = 'running'" :)

Am I just barking up the wrong tree and do you have a better fix?

Upgrade to Magento 2.2.6

Also, why you do not run cron every minute?

Related Topic