Cron Tasks are not working

Hi Team,

Cron Tasks are not working, We are using CWP7 Panel. There no errors in storage/logs/laravel.log. cd /home/ugcloudc/hbti.ugcloud.co.za && php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1, not sending any invoices. We have a VPS.

Thanks

Shikaar

@shikaar

First thing to do is send the output of your crons to logs and then inspecting your cron logs to check for any errors.

Jan 29 12:40:01 hwsrv-930542 CROND[21806]: (ugcloudc) CMD (cd /home/ugcloudc/hbti.ugcloud.co.za && /opt/cwp/ea-php74/root/usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1 )

I have the same issue. Below my Cron jobs but jobs are hanging. But when I remove the >/dev/null 2>&1 I get a lot of emails that cron jobs are not working

image

I don’t believe v5 supports PHP 7.4

@david is that correct?

@hillel

v5 does support php7.4. I’m running on it. :slight_smile:

@servitweb

You are mixing versions. This thread is labeled “Self-hosted | v5”. In that case “ninja:send-invoices” and “ninja:send-reminders” are leftovers from v4 and need to be deleted.

Then, you need to decide, if you want to run the queue XOR from database (sync). Your health check says you are trying to run the queue. The “queue:work” every 5 minutes is the queue worker. The “schedule:run” is the database sync worker. Its one XOR the other. If you decide to go back to running from database sync, make sure you only have a single “schedule:run”. In any case, you should only have one cron job.

You forgot to obfuscate the fifth cron job and where ineffective in obfuscating the four on top, which in this case was helpful to understand, that you are not starting several cron jobs for several instances of IN. Your second cron job apparently has an additional space before the “artisan”, so its trying to call php with the directory as first argument, which is for sure producing errors. The first and forth job are also calling php on the directory.

You should have either

5 * * * * /usr/local/bin/php /home/servitwebbe/facturatie.servitweb.be/artisan -d register_argc_argv=On queue:work --stop-when-empty
and probably add >/dev/null 2>&1 to the end of that

XOR (if you want to go back to running database (sync)

* * * * * /usr/local/bin/php /home/servitwebbe/facturatie.servitweb.be/artisan -d register_argc_argv=On schedule:run >/dev/null 2>&1

2 Likes

this solved indeed my problem.