Recurring invoices send at wrong date

Hello,

This morning my invoice ninja installation was automatically updated to 3.9 (at 08:00 with a cronjob).

Al 10:55, I have a cronjob running for checking the recurring invoices. I have set yearly recurring invoices at the following dates (dd-mm-YYYY):

  • 01-03-2018
  • 01-01-2018
  • 20-04-2018
  • 01-03-2018
  • 01-01-2018
  • 01-03-2018
  • 30-04-2018

Al those invoice are send today, at 13-11-2017 to my customers. There is also one monthly invoice, this one has not been send today.

My administration is now pretty f*cked up and my customers received invoices they should not receive.
Why are these invoices send today? Has it something todo with the update?

Sorry for the trouble!

It seems likely it’s related to the update. Can you send me the results of this SQL query:

select * from frequencies;

Is the frequency recurrence listed correct in the list and details views?

Also, do you know if the app was used after the update/before it sent the invoices?

I believe the cron requires the users to access the site to complete the upgrade, it may explain the problem.

Output of

SELECT * FROM frequencies;

id	name
1	Weekly
2	Two weeks
3	Four weeks
4	Monthly
5	Two months
6	Three months
7	Four months
8	Six months
9	Annually

The app was not used after the update / before it sent the invoices.

Thanks, I think I understand the problem.

In this release we added a four month frequency which required shifting the frequency ids. Since the app wasn’t used the cache wasn’t cleared so the app thought the invoices should be sent every 6 months.

You should be able to prevent this from happening in the future by using the updated version of the script which will loads /update to complete the upgrade.

https://www.invoiceninja.com/forums/topic/automatic-updates-still-not-quite-right/#post-9198

Oke thx, but where is the updated version? Can’t find the full example of the update script in the link you posted.

It’s the same link, the script has been updated to include a call to /update at the end.

https://pastebin.com/j657uv9A

Tnx for the quick reply.

Updated the script, but now I’m getting some strange output:

bin/bash: -
: invalid option

Fixed, my mistake. I had wrong line endings by copy and pasting the code!

I hate auto updates, much prefer manually doing it when all my open invoices and other critical items have been cleared. Is there a way to make sure we don’t have these issues without the auto update script? I assumed calling the /update page worked out all these update requirements no?

You should just need to login to the app after updating the codebase.