CRON Configuration

Any thoughts guys…? I hope this is the last issue with this install.

First, edit your .env file makeing sure your APP_URL doesn’t have a trailing slash; so it should be

APP_URL=“https://sub.domain.com

not

APP_URL=“https://sub.domain.com/”

Then your cron job should be

cd /dir/where/your/.env-file-is-located && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

making sure /usr/local/bin/php is the php8.1 version. The cron job needs to run once every minute. My cronjob looks like

* * * * * cd /var/www/invoiceninja && php artisan schedule:run >> /dev/null 2>&1

Then you need to wait for at least once pass the hour of 00:00 til 01:00 UTC. The version check is done only once a day during that hour. After that, can you check your storage/logs/laravel.log and let us know if there are any errors?

1 Like

Thanks xoo

I think I have it all setup now.

This part may possibly need a change:

cd /home/alltbilling/public_html/public/ && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

But I will have to wait and see…

Did the changes you made to the cron jobs work for you?

Unfortunately not no.

This is quite urgent now.

@david do you have any suggestions?

@infowhatnowebsite-co

Do you have command line access?

It may be helpful if you run the cron commands from the command line to see whether they actually execute correctly.

Also, if you are able to inspect the cron.log files there may be further information in there.

I tried running this from the cammand line:
/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run > /dev/null 2>&1

And nothing happened, not even an error.

try

/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run

the command you are running pipes the output to dev/null

Hi David

OK, is that wrong?

The command you ran is fine for your cron, but for the purpose of testing, we just needed to drop the > /dev/null piping

Thanks David

I ran:

/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run

And no output.

I think this is the last thing that needs fixing so hope you can help.

An update…

I spoke with the server admins and they inform me that the cron is running.

However, in the UI I still get the warning triangle.

@infowhatnowebsite-co

In your .env file set

EXPANDED_LOGGING=true

then refresh the cache with

php artisan optimize

You’ll then want to run the schedule command above and then inspect your log file in storage/logs/invoiceninja.log

you should see an entry there like this if the scheduler is actually running.

latest version = v5.5.28

Thanks David

I updated the ENV file but when I tried to run that commend through terminal I got the following error:

[root@server ~]# cd /home/alltbilling
[root@server alltbilling]# php artisan optimize
Could not open input file: artisan
[root@server alltbilling]#

Good morning

Any update guys…?

It would be nice to get some help.

@david do you have any suggestions?

It doesn’t fill me with confidence guys. It’s your software, the cron job configuration has been verified by the server admins but yet I still have issues.