Magento - cron job script is running, but Magento order confirmation emails are not sending

Zachary Beschler

As the Magento documentation states, you need to set up a cron job on your web server in order to get things like order confirmation emails to send out, like so:

* * * * * /bin/sh /absolute/path/to/magento/cron.sh

This is a very simple cron job. The issue is, automated tasks are not completing in Magento. It's as if the script isn't being run by the cron job. And as a result, order confirmation emails are not sending (among all the other Magento automated tasks).

I've installed the AOE Scheduler extension to double-check every automated task in Magento and see when tasks are completing (or, in this case, when they're not). None of the tasks including core_email_queue_send_all are completing on the 1-minute-interval basis.

Now here's the weird part. If I just go run the cron.php script (cron.sh triggers cron.php) by loading it up in my web browser at mydomain.com/cron.php, the Magento automated tasks all execute! And since the script works like this when I run it manually, and I know cron jobs are working...I can't figure this out!

Please help!

ADDITIONAL DETAILS

Here's how I know cron jobs are working—I have tested cron jobs on my server by creating a PHP script that sends a basic email with mail(), and ran a similar cron job to the one above to execute it every minute—the cron job functions normally. I am also getting MAILTO emails from the server every time the cron job runs. No errors that I can see.

I can also execute this exact command in the cron job...

/bin/sh /absolute/path/to/magento/cron.sh

...in Terminal when I SSH in, and it runs the script successfully and Magento runs all automated tasks. It just doesn't run every minute in the cron job!

This is totally weird and I can't figure it out.... At the end of the day, all this work I did on this Magento store is moot if customer's can't check out and get confirmation emails.

Any advice would be extremely appreciated.

UPDATE

I was able to get by with using a wget command to call cron.php, but this still doesn't feel like a permanent solution.

wget -O /dev/null -q http://domain.com/cron.php

While it's technically working now, Magento's documentation specifically recommends running cron.sh, not cron.php. Still would love a concrete answer to why the cron job won't run cron.sh with sh.

Thomas Lang

Some steps I would be trying:

In terminal:

Check your cron log:

tail -f /var/log/cron

Can you see the commands being run?

Check if cronjobs are present:

crontab -l

Check if the cron user has executable permissions for the file, if not:

chmod +x file.sh

Is cron running? check to see if a process is running:

pgrep crond

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Magento is not sending order confirmation emails

From Dev

Magento 1.9.1.0 Order Confirmation Emails - Not Sending

From Dev

Magento 1.8.1 Not sending Order/Invoice emails

From Dev

Magento indexer running via ssh but not cron job

From Dev

Magento 1.8.1.0 Order Confirmation Emails - Send the email again to sales only

From Dev

Magento cron job not working

From Dev

Cron Job issue Magento

From Dev

conditionally sending cron job emails

From Dev

conditionally sending cron job emails

From Dev

Magento 2 : Send Order Confirmation email from script

From Dev

Editing Magento order confirmation email

From Dev

Magento 1.9.1.0 Order confirmation not send

From Dev

Email not sending on new order in magento

From Dev

Email not sending on new order in magento

From Dev

Magento: How to modify the HTML of the order confirmation page?

From Dev

Magento Edit Email Order Confirmation Template NOT in the backend

From Dev

Magento order confirmation email with shipping estimates

From Dev

Create Magento cron job task programmatically

From Dev

How to set up a cron job in Magento

From Dev

Magento Cron Job Error - Invalid Callback

From Dev

Sending copy of confirmation email on particular amount of products (Magento)

From Dev

Custom message in New Order Confirmation Shippin Method Magento CE

From Dev

Magento Observer send confirmation

From Dev

Magento: Importing / updating LOTS of products via cron job?

From Dev

cron job is working in magento site- But No heartbeat found

From Dev

Magento PHP cron job fail to open required php files

From Dev

Shell script with a cron job to start a program if not running?

From Dev

Running bash script as Cron job with R Markdown

From Dev

Cron job to check if PHP script is running, if not then run

Related Related

  1. 1

    Magento is not sending order confirmation emails

  2. 2

    Magento 1.9.1.0 Order Confirmation Emails - Not Sending

  3. 3

    Magento 1.8.1 Not sending Order/Invoice emails

  4. 4

    Magento indexer running via ssh but not cron job

  5. 5

    Magento 1.8.1.0 Order Confirmation Emails - Send the email again to sales only

  6. 6

    Magento cron job not working

  7. 7

    Cron Job issue Magento

  8. 8

    conditionally sending cron job emails

  9. 9

    conditionally sending cron job emails

  10. 10

    Magento 2 : Send Order Confirmation email from script

  11. 11

    Editing Magento order confirmation email

  12. 12

    Magento 1.9.1.0 Order confirmation not send

  13. 13

    Email not sending on new order in magento

  14. 14

    Email not sending on new order in magento

  15. 15

    Magento: How to modify the HTML of the order confirmation page?

  16. 16

    Magento Edit Email Order Confirmation Template NOT in the backend

  17. 17

    Magento order confirmation email with shipping estimates

  18. 18

    Create Magento cron job task programmatically

  19. 19

    How to set up a cron job in Magento

  20. 20

    Magento Cron Job Error - Invalid Callback

  21. 21

    Sending copy of confirmation email on particular amount of products (Magento)

  22. 22

    Custom message in New Order Confirmation Shippin Method Magento CE

  23. 23

    Magento Observer send confirmation

  24. 24

    Magento: Importing / updating LOTS of products via cron job?

  25. 25

    cron job is working in magento site- But No heartbeat found

  26. 26

    Magento PHP cron job fail to open required php files

  27. 27

    Shell script with a cron job to start a program if not running?

  28. 28

    Running bash script as Cron job with R Markdown

  29. 29

    Cron job to check if PHP script is running, if not then run

HotTag

Archive