Magento does almost all of its background work through cron: order confirmation emails, indexing, catalog price rules, sitemaps, newsletters and message queue consumers. When cron stops, the storefront keeps loading, so nothing looks broken. You usually find out from customers who never received their order email, or from prices and stock that stopped updating.
What it looks like
- The admin shows “One or more indexers are invalid. Make sure your Magento cron job is running.”
- Customers stop receiving order confirmation emails.
- Price changes, catalog price rules and stock updates do not reach the storefront.
- Newsletters and sitemaps are not generated.
Confirm cron has stopped
Magento records every job it runs in the cron_schedule table. Check when anything last ran:
SELECT MAX(executed_at) FROM cron_schedule;
Cron runs every minute, so anything older than a few minutes means it is not running. The times in this table are in UTC.
Why it happens
- The crontab line is missing, often after a server migration or a new deployment.
- It was installed under the wrong user, usually root, so jobs fail on file permissions or create files the web server cannot change.
- The PHP binary in the crontab is wrong, for example an old PHP version left behind after an upgrade.
- The system cron service is stopped.
cron:runitself fails with a PHP error before running any job.
How to fix it
1. Check the crontab of the user that owns your Magento files, usually www-data:
crontab -u www-data -l
2. It must contain a line that runs bin/magento cron:run every minute, like this:
* * * * * /usr/bin/php /var/www/magento/bin/magento cron:run >> /var/www/magento/var/log/magento.cron.log 2>&1
If it is missing, install it as that user:
sudo -u www-data php bin/magento cron:install
3. If the line is there, run it by hand as the same user to see the real error:
sudo -u www-data php bin/magento cron:run
4. Make sure the system cron service is running:
systemctl status cron
5. Check the store is not stuck in maintenance mode, which also stops cron jobs from doing their work:
bin/magento maintenance:status
After it is running again
Queued work catches up on its own over the next few runs. Order emails waiting in the queue are sent, and scheduled indexers update. If indexers stay invalid, rebuild them once with bin/magento indexer:reindex.
Keep it from happening again
- Always install cron as the web server user, never as root.
- Re-check the crontab after every server move or PHP upgrade.
- Monitor the time of the last cron run, not just whether the crontab line exists. A line can be present and still fail every minute.
Catch it automatically
MageMonitor checks for this every few minutes as part of its Cron Health checks, and alerts you by email, Slack or webhook the moment it appears, with the exact commands to fix it. See MageMonitor for Magento 2.
