'Why I get this error laravel-worker: ERROR (no such group)
I followed the official Laravel doc to start queue in the background using supervisor in Centos 7.
But whene I run this command sudo supervisorctl start laravel-worker:*
I get this error laravel-worker: ERROR (no such group)
Documentation: https://laravel.com/docs/5.5/queues#supervisor-configuration
Solution 1:[1]
I tested it out and created a new server with no supervisor configurations at all. These were my steps to get it running:
# 1. create the config file, see below for content
vi /etc/supervisor/conf.d/laravel-worker.conf
# 2. Reload the daemon's configuration files
supervisorctl reread
> laravel-worker: available
# 3. Reload config and add/remove as necessary
supervisorctl update
> laravel-worker: added process group
# 4. Start all processes of the group "laravel-worker"
supervisorctl start laravel-worker:*
# 5. Get status for all processes of the group "laravel-worker"
supervisorctl status laravel-worker:*
> laravel-worker:laravel-worker_00 RUNNING pid 23758, uptime 0:00:16
> laravel-worker:laravel-worker_01 RUNNING pid 23759, uptime 0:00:16
# 6. After a change in php sources you have to restart the queue, since queue:work does run as daemon
php artisan queue:restart
> Broadcasting queue restart signal.
/etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work --sleep=3 --tries=2
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/supervisor_queue-work.log
Solution 2:[2]
I've the same problem on my cloud based vps. Please check the bottom of supervisord.conf file.
You can find it on
nano /etc/supervisord.conf
You should carry the [includes]
section on the configuration file. If the section looks like above.
[include]
files = supervisord.d/*.ini
change the files parameter extension to .conf instead
[include]
files = supervisord.d/*.conf
otherwise supervisor can not find the laravel-worker configuration.
Solution 3:[3]
Be sure that the top of your config file is correct. Example:
[program:laravel-worker]
The below will cause your problem:
[program: laravel-worker]
[laravel-worker]
Cheers
Solution 4:[4]
Put quotes around worker name sudo supervisorctl start 'laravel-worker:*'
Solution 5:[5]
See the process name on config file. my file was like this
[program:omni-delivery-dev-server.config]
...
and it stayed like this
[program:omni-delivery-dev-server]
...
Solution 6:[6]
If you have centos8 locate and check supervisor.conf . At the very last you may find
[include]
files = supervisord.d/*.ini
So don't worry rename your-file.conf
to your-file.ini
and try these commands again
supervisorctl reread
If you see the change then this is success.
supervisorctl update
supervisorctl start laravel-worker:*
note: if you get some supervisorctl start laravel-worker:*
message
try adding quote in
supervisorctl start 'laravel-worker:*'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PKeidel |
Solution 2 | bl4cksta |
Solution 3 | Adam Kozlowski |
Solution 4 | amrography |
Solution 5 | DEV Tiago França |
Solution 6 | Jay Momaya |