Thanks @david . Finally getting around to trying this on my InvoiceNinja 5.5.102 installation. To be totally clear, here’s what I’ve done:
•Installed Supervisor:
sudo apt-get install supervisor
•Created a configuration file for InvoiceNinja:
cd /etc/supervisor/conf.d
sudo vi my-laravel-worker.conf
•Used the example config file I posted from my last post, but changed the following 3 lines as you suggested:
command=php /path/to/invoiceninja/artisan queue:work sqs --sleep=3 --tries=3 --max-time=3600
user=<WebServerUser>
stdout_logfile=/log/path/my-laravel-worker.log
•Created the log file
sudo touch /log/path/my-laravel-worker.log
sudo chown <WebServerUser>:<WebServerUser> /log/path/my-laravel-worker.log
•Now that Supervisor was set up, ran:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start my-laravel-worker:*
Next, I went ahead and changed the Invoice Ninja .env file and edited the line for QUEUE_CONNECTION to read:
QUEUE_CONNECTION=database
I then restarted PHP FPM and Apache. I refreshed Invoice Ninja in my browser and it hung for a very long time, and during this time, server resources completely skyrocketed and maxed out memory usage and the system became unresponsive. After a few minutes, I gained control back and Invoice Ninja finished loading in the web browser.
If I run sudo supervisorctl status I see 8 workers with a status of RUNNING (numbers 00 through 07). If I check the log file I created, I see this over and over (which also seems to be the exact issue reported here):
In Connection.php line 760:
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from inform
ation_schema.tables where table_schema = <InvoiceNinjaDatabase> and table_nam
e = accounts and table_type = 'BASE TABLE')
In Connector.php line 70:
SQLSTATE[HY000] [2002] No such file or directory
Lastly, if I run a health check on Invoice Ninja, it still shows Queue: Sync.
What am I missing?