cancel
Showing results for 
Search instead for 
Did you mean: 

magento 2 cron not working

magento 2 cron not working

I started a new message hours ago, never saw it appear on the forum not sure where it went? It was a problem I had with cron. Looks like I need to re-write it for whatever reason...

 

Ok so for the life of me I cant get magento's cron working. Here are some details and info of my current setup.

 

Server:

  • godaddy vps
  • centos 6
  • WHM + Cpanel

I have two users set up, one which is the admin of the server, another user which is the owner of the magento site im having an issue with. Below are the commands I used.

 

* * * * * php-cli public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> public_html/var/log/magento.cron.log
* * * * * php-cli public_html/update/cron.php >> public_html/var/log/update.cron.log
* * * * * php-cli public_html/bin/magento setup:cron:run >> public_html/var/log/setup.cron.log

I have tried entering these into a crontab or via logging into my cpanel for my magento website user and going to the crontab and entering each command in. My cron log on the server shows each command firing off every minute with no errors. inside of magentos cron.log I get nothing at all. I can also log into my server via ssh with the magentos website user and can input the above command into my terminal and the cron job runs just fine.

 

For whatever reason I cant figure out why my commands are running via command line but not through cron. Any ideas?

 

edit: do any of you know where cron tries to run from? I tried using the absolute path of my magento install but that gives me errors because my magento sites user account does not have root privileges.

 

4 REPLIES 4

Re: magento 2 cron not working

https://github.com/magento/magento2/issues/5836

Think its a know bug being worked on. Hopefully fixed on next version.

Re: magento 2 cron not working

Thanks for the reply. I've been going crazy trying everything lol. Everything seems correct and I don't get any errors in the log however after reading what you wrote, I checked debug.log and it looks similar. At least I'm not going crazy. I guess i'll continue to work on the site and deal with this issue when I'm ready for launch if it hasn't been patched by then.

 

edit: I did a little more research and im going to try it again this time defining my PATH, maybe i'll get lucky lol.

Re: magento 2 cron not working

Im in the same boat, i just keep working on the site hoping that a patch/update will be out very soon. Did you try the index:reindex method through a cron job as suggested on that link. That way works but its not ideal at all.

Re: magento 2 cron not working

When you say "index:reindex method through a cron job" do you mean running that command via command line? I have done that and it works fine. I guess as long as all the sale's email's etc go through I should be able to live with it for now.