I am using supervisor in laravel some time my supervisor work fine and some time got error. FATAl Exited too quickly (process log may have details).
This is my supervisor file.
[program:laravel-worker-mail]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/new-project/artisan queue:work mongodb --sleep=10 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/html/new-project//storage/logs/worker.log
Please suggest me if anybody have good idea about this.
In my case, the supervisor was exiting very fast because it was finishing before the startsecs and since startsecs wasn't defined, it uses the default which is 1.
Setting startsecs=0
fixed my issue.
I solved the problem myself by searching and applying a number of methods, I found my solution by adding --daemon
in command
updated code below
[program:laravel-worker-mail]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/new-project/artisan queue:work mongodb --sleep=10 --tries=3 --daemon
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/html/new-project/storage/logs/worker.log
For anyone still having the same issue despite following the accepted answer. It turned out that I was referencing the wrong queue method "sqs" instead of the one I was using which was "database".
command=php /var/www/html/new-project/artisan queue:work database --sleep=10 --tries=3 --daemon
[program:laravel-worker-mail]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/new-project/artisan queue:work database --sleep=10 --tries=3 --daemon
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/html/new-project/storage/logs/worker.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With