V5 Cronjob Red Exclamation Mark

I have a cron job set up and running as the www-data user

 * * * * * cd /var/www/invoiceninja && php artisan schedule:run >> /tmp/cronoutput.log 2>&1

the cron runs and just says

No scheduled commands are ready to run.
No scheduled commands are ready to run.

But in the invoice ninja v5 interface i get the error “the cron needs to be enabled”. refreshing the data doesn’t change anything. Latest version of invoice ninja on Ubuntu 20 with nginx

@david any thoughts to debug this?

Can you try to explicitly specify the version of php you run for InvoiceNinja in the cron job?

 sudo -u www-data crontab -e

 * * * * * php7.4 /usr/share/nginx/"""invoiceninja"""/artisan schedule:run >> /dev/null 2>&1

This works for me when running with php7.4-fpm. Because I have a blog with grav installed that has higher php dependencies, I must specify php7.4 everywhere in IN configurations. I suggest you make it a practice too if you run multiple services on your system.

Will give that a try. Can you explain what putting invoiceninja in the 3 sets of quotes does/is for?

Gave that a go and when i went to my invoiceninja instance the red alert had gone. Not sure if it was that that fixed it though as when I change back to my old cron its still gone

I think it may have fixed itself overnight - the original cron task i setup seems to work too and it hasn’t reappeared

Sounds like just an issue with cron getting running then, glad it’s sorted.

I put the path name in triple quotes to indicate it is a comment, and you should change your own path.

1 Like