Yes, I posted the config further up and we checked the output.
Here are the crontab entries:
4-59/5 * * * * cd /home/beechesit/domains/accounts.beeches.it && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
3-59/5 * * * * cd /home/beechesit/domains/accounts.beeches.it && /usr/bin/php -d register_argc_argv=On artisan queue:work --stop-when-empty
I suspect this is the root cause:
[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘accounts.jobs’ doesn’t exist at /home/beechesit/domains/accounts.beeches.it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)
Ooh, I found this in /var/log/invoiceninja-worker.log (in the server root, not the site root)
In Connection.php line 829:
SQLSTATE[HY000] [2002] No such file or directory (Connection: mysql, SQL: s
elect table_name as `name`, (data_length + index_length) as `size`, table_c
omment as `comment`, engine as `engine`, table_collation as `collation` fro
m information_schema.tables where table_schema = 'accounts' and table_type
in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)
In Connector.php line 65:
SQLSTATE[HY000] [2002] No such file or directory
2024-06-27 08:25:16 App\Listeners\Contact\UpdateContactLastLogin ... RUNNING
2024-06-27 08:25:16 App\Listeners\Contact\UpdateContactLastLogin 111.87ms DONE
2024-06-27 08:25:16 App\Listeners\Misc\InvitationViewedListener .... RUNNING
2024-06-27 08:25:16 App\Listeners\Misc\InvitationViewedListener 108.26ms DONE
2024-06-27 08:25:21 App\Listeners\Invoice\InvoiceViewedActivity .... RUNNING
2024-06-27 08:25:22 App\Listeners\Invoice\InvoiceViewedActivity .... 1s DONE
The situation’s getting worse, I now have “php is not writable” errors in the Health Check window and I can no longer view PDFs. I see I’m in good company with all these issues. All features I need are here, I just can’t work out how to use them and I need to get my invoices out quickly!
Should I do a clean reinstall? If so, can I re-import all my data?
Should I install from a Docker image instead so it’s more of a known environment, or will that just create as many problems as it solves? Again, what happens to my data?
Should I migrate everything to the hosted platform? Is that even possible?
Should I give up? I’m guessing you don’t want to lose customers but you’re probably sick of hearing about my problems by now.
Update: I may have found a workaround for the PDF issue (incorrect library dependency) and the missing reminders (incorrect cron job documentation). Still struggling with php not writable, nothing in logs and chmod 777 on absolutely everything doesn’t help. Still tempted by docker but can’t find docs. Getting late, will separate issues and update tomorrow.
I may have found a solution to the “invoice reminders not sent” issue.
In the documentation for v4 under SELF HOST > Configure > Recurring invoices and reminder emails there is reference to setting up a pair of cron jobs to to call the ninja:send-invoices and ninja:send-reminders commands. The send-invoices one just returns an error but the send-reminders one does appear to have triggered the sending of at least one reminder.
However, I can find no mention at all of an equivalent cron job in the v5 documentation. If this is indeed an omission it’s a serious one.
Update: Schedules are still not happening. No emails received as a result of the BCC option and under Advanced settings > Schedules the “Next run” is in the past.
Is there another missing cron job I don’t know about?
Also, I managed to get rid of the errors in the /var/log/invoiceninja-worker.log which now looks fine, but it has not improved the delivery of reminders or scheduled statements.
I’ve just inherited a bunch of customers and this issue has become urgent. What can I do to get this resolved?
The ninja:send-reminders solution I mentioned above seems to have only worked once. I didn’t really expect it to work anyway because it’s a v4 thing so I think that’s a dead end.
The thread is a bit confusing now and I think there’s more than one problem (invoice reminders not being scheduled and reminders not being sent even when they are scheduled) so here’s a summary of the current status as I see it.
If I look at the dates on my overdue invoices, only the most recent has a “Next send date”. How do I enable reminders for the older ones?
Even when there is a sent date, nothing happens when the date is reached. The ones in the screenshot that show a date in the “Reminder Last Sent” column were manually triggered by me, not automatically as configured. As far as I can tell, reminders have never been sent automatically by the system. I have a BCC set up so that I see them. That BCC works when invoices are sent out.
I have two cron jobs set up, both to run every 5 minutes and neither of which return errors (with the /dev/null removed, obviously). They run as the web user (“beechesit” in this case).
cd /home/beechesit/domains/accounts.beeches.it && /usr/bin/php artisan schedule:run >> /dev/null 2>&1
cd /home/beechesit/domains/accounts.beeches.it && /usr/bin/php artisan queue:work --stop-when-empty
I am not currently seeing any relevant errors in the logs, either at the time of invoice creation or at the time the reminders are supposed to be sent.
Resaving reminder settings and invoices has made no difference, however there is some progress.
I was trying to change settings in “Email settings” and getting a frustrating “Something went wrong” popup every time I saved them. I tried saving in the desktop client instead of the browser and it succeeded - and a bunch of reminders went out! (All out of date, which I now have to apologise for.)
The only problem is, I’m not sure which setting (if any) made the difference. The test emails have always worked. And I’m still seeing that “something went wrong” message from a browser.
I now see these entries in the “expanded logging”, which I’ve never seen before:
The problem with the blank “Next Send Date” hasn’t changed, which I think probably means the burst of reminders was a one-off. Only time will tell.
The other bit of information I can report is that when I said before that the “next send date” was sometimes in the past, I can now only see those on “Sent” invoices. That’s still confusing (would be better blank) but not necessarily a symptom of the reminder failure. Also, I have seen the nonsensical “next date in the past” on overdue invoices previously (there’s a screenshot of that further up the thread, I’m not imagining it). So something has changed - I’m on a later version of InvoiceNinja now so perhaps a bug was fixed.
It’s getting late so I’ll continue tomorrow but at least there’s some progress to report.
I don’t think so. There are some new errors but I’m not sure they’re related. They may be simply due to me experimenting with different settings to try to find the problem by trial and error. An example is: [2024-11-05 23:00:26] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'expense_mailbox' in 'field list'
I’m tied up at the moment dealing with fallout from a bunch of customers receiving reminders for invoices they’ve already paid.
I may have found the cause, though - it seems to correlate with having any entry at all in Advanced Settings > Email Settings > Reply-To Name