Duplicate Recurring Invoices
-
No solution to this? InvoiceNinja just broken for recurring invoices? Is that the conclusion?
-
They told me to check crons. I can't see any, so I'm not sure what to do.
Also, I mentioned above in the Cloudron docs it says the cron logs are located at /app/data/storage/logs/cron.log. but that file doesn't exist for me.
-
Hm, the package does not actually use cron as such but two long-lived processes working the schedule and queue: https://git.cloudron.io/cloudron/invoiceninja-next-app/-/tree/master/supervisor?ref_type=heads
Are both up and running in your failing instance?
-
Yes, they're running.
-
@Dave-Swift looks like the docs are quite obsolete. I am cleaning them up now.
-
@Dave-Swift I think I have found the issue. Looks like we active the internal cron and the package also has a cron of it's own. Getting fixed.
-
@Dave-Swift Can you please try with package 1.12.0 ?
-
Unfortunately the double billing is still occurring.
-
@Dave-Swift can you check if
/app/data/env
hasINTERNAL_QUEUE_ENABLED=false
? -
Yes it does.
-
Any ideas on how to solve this? I love InvoiceNinja but haven't fully implemented it because of this issue. Should I just try a fresh install?
-
To investigate further, I performed an analysis of all the running processes on my system using the ps aux command.
Here are the relevant processes I found:- Queue Worker Process:
www-data 2129 0.0 0.3 194696 104424 pts/0 S 23:12 0:01 php /app/code/artisan queue:work database
This process is running the Laravel Artisan queue:work command with the database queue connection.
- Schedule Worker Process:
www-data 37 0.0 0.3 192452 103156 pts/0 S 22:18 0:05 php /app/code/artisan schedule:work
This process is running the Laravel Artisan schedule:work command, responsible for executing scheduled tasks.
Apart from these processes, I found multiple Apache web server processes and a Supervisord process, which I don't think are related to the queue or InvoiceNinja application.
Is the presence of a single queue worker process and a separate schedule worker process expected in the standard InvoiceNinja setup on Cloudron?
Could the schedule worker process be contributing to the duplicate recurring invoices issue, or is it unrelated?
Are there any other processes or configurations I should investigate further to identify the root cause of the duplicate recurring invoices problem?
Thank you for your assistance and guidance in resolving this issue.
-
I was reading again through the cron section at https://invoiceninja.github.io/en/self-host-installation/ and I while I don't fully get it, I think the root issue is, that we run both a scheduler and the queue worker and it seems one is sufficient. But I am not 100% sure from those docs.
I have published a new package which disables the scheduler and only relies on the queue. @Dave-Swift can you check if this solves the problem?
-
Thanks @nebulon. I have installed the update and will let you know when I have enough data. Fingers crossed.
-
@nebulon My recurring invoices are now not running at all.
-
Thank you, I updated and payment went through right away.
I wonder if recurring invoices I made before the first change you made were still billed twice but the new ones will only be billed once?
Do you think that is possible? I tried doing some daily test recurring invoices and they were not billed in duplicate.