SendRecurringInvoices... No such file or directory

Self-hosted Invoice Ninja v4.5.11 stopped sending out recurring invoices last month. Today, I exported all data in JSON format, then imported that data into a freshly installed v4.5.19; but am getting the same error when I run the artisan command.

php artisan ninja:send-invoices
Fri, 17 Jul 2020 19:05:19 +0000 Running SendRecurringInvoices...

In Connection.php line 664:

  SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `accounts` where `reset_counter_frequency_id` > 0 and `accounts`.`deleted_at` is
  null order by `id` asc)


In PDOConnection.php line 47:

  SQLSTATE[HY000] [2002] No such file or directory


In PDOConnection.php line 43:

  SQLSTATE[HY000] [2002] No such file or directory

It looks like your db configuration isn’t setup yet… ie the app couldn’t connect to the database.

When I use the Settings / System Settings / Database Connection / Test Connection button, it comes back with “Success”. Does the command line “artisan” utility use a different connection config setup?

I’m not 100% sure, i think the issue may be that your DB connection has changed from localhost to 127.0.0.1 you may need to try adjusting as it looks like the app isn’t able to find mysql

You’re the man. That was it.
Thanks!

1 Like

FYI… you may want to consider using mysqldump instead of the JSON option to transfer between selfhost installs