Unable to send emails. Could not acquire lock for cron job: sales_send_order_invoice_emails
-
14-04-2021 - |
Question
Unable to send any kind emails (order, invoice, tracking). I get confirmation that it was sent, but nothing received. Same with "Contact us" from frontend.
cron.log:
main.WARNING: Could not acquire lock for cron job: sales_send_order_emails
main.WARNING: Could not acquire lock for cron job: sales_send_order_shipment_emails
main.WARNING: Could not acquire lock for cron job: sales_send_order_invoice_emails
main.WARNING: Could not acquire lock for cron job: outdated_authentication_failures_cleanup
main.WARNING: Could not acquire lock for cron job: bulk_cleanup
Permissions are correct (i think):
Magento 2.3.5-p2, PHP 7.2
Problem persisted after upgrade to Magento 2.4 and PHP 7.3 and 7.4
Couldn't find much online about "Could not acquire lock for cron job".
Any help will do.
Autres conseils
I guess Magento cron job is stuck in "running" status. Need to kill the stuck cron job then it will continue as scheduled.
- Log in to your account using SSH.
- Run the following command to locate hanging cron jobs:
$ ps ufx | grep cron
- To stop the cron from running, kill the command by referencing the PID. Run the following command to terminate the command:
$ kill -9 PID