← Back to Baseline

Why it Matters

Magento cron jobs must run continuously to handle indexing, order processing, emails, and cleanup. If cron stops running, jobs get stuck in “pending” and never finish. This breaks core functions, delays customer notifications, and can leave security tasks unexecuted.

A healthy cron heartbeat means jobs execute regularly without long gaps. Monitoring it ensures background processes remain stable and prevents silent failures.

Verification Steps

Magento CLI

# Check cron heartbeat
bin/magento cron:check
# Expected: "Magento cron is running"

Database check

SELECT job_code, status, scheduled_at, executed_at, finished_at
FROM cron_schedule
ORDER BY scheduled_at DESC LIMIT 5;

# Expected: jobs executed recently, no large backlog

Remediation / Fix Guidance

  1. Verify crontab entries exist and run every minute (see MB-R046).
  2. Check var/log/magento.cron.log for errors or timeouts.
  3. If cron is stuck, clear cron_schedule rows in “pending” state and restart PHP-FPM/cron service.
  4. Set up external monitoring/alerts if no cron jobs finish in the last X minutes.

Examples

Fail Example
$ bin/magento cron:check
Magento cron is not running

# Database shows backlog
job_code      status   scheduled_at
sales_email   pending  2025-10-01 12:00:00
# FAIL
Pass Example
$ bin/magento cron:check
Magento cron is running

# Database shows jobs executed recently
job_code        status   executed_at
sales_email     success  2025-10-01 12:00:05
# PASS

References