Recurring invoices did not send, then only partially sent

I did a test. there were 7 of those invoices with last sent of 2023-04-26 and next_send_date of 2023-05-26.

I manually updated one recurring invoice record with these values:
last_sent_date: 2023-04-25 14:30:00
next_send_date: 2023-05-25 00:00:00

It sent at 10:30AM EST or 14:30 UTC after manually running php artisan ninja:send-recur.

Under the www-data user, the crontab entry is there. Should it be under root or my user?

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

The app uses two columns here, 1. next_send_date_client is the field that you see in the app that shows the date the recurring invoice will send.

the next_send_date is the UTC time that the invoice sends, this time is calculated based on the clients locale / the send time ( in Email Settings)

Yeah I think I have that worked out now. I had a few that were set to next day in utc, because they ran so late last time and that’s fixed. However, the ones that were set for the correct day time still didn’t run on their own via the cron job.

Why did the cron job stop working? They don’t generate or send at all until I run manually. Is there a log I can check?

Now, I’m assuming, every recurring invoice that didn’t send and should have would be found the next time it fires. That may not be the case.

I’m using Ubuntu 22.04 lts. Haven’t changed anything

Every hour the recurring cron runs, we structure the query to search for all invoices with a next_send_date < the current time, so as long as the recurring invoice is less than “now” it will get picked up.

It may help to turn on expanded logging in the .env file using the following

EXPANDED_LOGGING=true

The will output data to storage/logs/invoiceninja.log and you’ll be able to see the frequency of the recurring invoice cron and how many recurring invoices it is processing each hour.

Thank you, I’ll turn it on.

Always appreciate your help!