I have recently upgraded a Docker container image to 2.7.2.
This system has 4 recurring invoices and the system has created a draft of the first recurring invoice for this month.
The CRON container log shows the following:
2016-10-13 Running SendRecurringInvoices...
4 recurring invoice(s) found
Processing Invoice 6 - Should send YES
Sending Invoice
[ErrorException]
Trying to get property of non-object
2016-10-13 Running SendReminders...
0 accounts found
Done
So, any clues on how I can resolve this?
All 4 recurring invoices have been sent before manually. This is the first time CRON has been enabled & ready to send on the Docker version. Note, it was active previously when I had 2.7.1 installed and the log had shown that invoices were not yet due to be sent. Send date is 9th of the month.
I did that via the browser but not sure if it will work since the CRON container is a separate container to APP container… not sure how to do the equivalent on CRON??
I stopped and restarted all containers to re-trigger CRON… checked the laravel-error log and the same messages have been added to existing.
Hmm, not sure… i can tell you since i’ve started it 3 times now, it’s created 3 of the recurring invoices. All with status DRAFT instead of sent…
Ahhhh… I just had an idea…
The ENV file!! Remember how I said the main app would not work after the 2.7.1 update because it was wiping the ENV file and I had to move the ENV to persistent storage… since the CRON container is running independently, it does not see the ENV…the persistent storage volumes I used for the app were not copied to the CRON container… I didn’t know it needed it…I didn’t realise until now it was independent…
So… adding the APP volumes to the CRON container…
Voila… fixed!!
The 3 invoices in draft mode remained in DRAFT… I sent them manually but the fourth was created and sent automatically…
Things we learn… hopefully that helps someone else.
All makes sense now… maybe the code that checks to see if the invoice should be sent also checks if the status is sent rather than leaving them stuck in DRAFT status… mind you it should not happen if correctly configured.