Why I get this error laravel-worker: ERROR (no such group)
Asked Answered
F

8

9

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

Flann answered 21/2, 2019 at 15:48 Comment(6)
the current version is 5.7, there the queue:work command looks a bit different laravel.com/docs/5.7/queues#supervisor-configuration But to your problem: is your file called laravel-worker.conf?Nephoscope
Another error could be caused by that https://mcmap.net/q/434008/-getting-error-on-supervison-on-supervisorctl-error-no-such-process-closedNephoscope
I use Laravel 5.5. Theire are no difference in queue:work commandFlann
Did you test the steps under "Starting Supervisor" in the docs?Nephoscope
@Nephoscope yes I've followed this docs step by step.Flann
In my case, I had this issue because I created my laravel-worker.conf on the same level with directory 'conf.d'. You have to cd into 'conf.d' to create your worker fileHovis
N
31

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
Nephoscope answered 27/2, 2019 at 10:34 Comment(6)
thanks, but in my Centos env i got default config include set to *.ini , so I renamed my conf extension as it is. [include] files = supervisord.d/*.iniMako
Thanks, its solved my issue... Can you please tell how this "user=www-data" user value will come ?Escalator
This just means that the command should be run as another user. You can create a user with minimal access rights and use this user for your queue workerNephoscope
@SyamkumarKK "www-data" is the default apache userSalim
as @bl4cksta mentionned, you should check configuration file extension and location in /etc/supervisord.conf (bottom of file). It was for me *.ini I renamed it to *.confFlann
for me apache instead of www-data Centos 8Flann
M
6

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.

Magnetohydrodynamics answered 6/11, 2019 at 17:4 Comment(0)
S
4

Put quotes around worker name sudo supervisorctl start 'laravel-worker:*'

Salim answered 24/2, 2022 at 8:48 Comment(0)
A
1

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

Altdorf answered 19/8, 2019 at 15:7 Comment(1)
my error was also related to the process name. Your suggestion helped me to identify my error. ThanksPargeting
F
0

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]
...
Frilling answered 4/1, 2022 at 1:5 Comment(0)
R
0

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:*'
Reo answered 22/4, 2022 at 14:7 Comment(0)
P
0

in new version of supervisor configuration file format is *.ini not *.conf so rename your file laravel-worker.conf to laravel-worker.ini and run other commands

supervisorctl reread
supervisorctl update
supervisorctl start laravel-worker:*
Pinchbeck answered 23/1, 2023 at 11:22 Comment(0)
G
0

The supervisor looks for new configuration (.conf) files according to the paths defined in the [include] section of the supervisord.conf file.

[include]
files = /etc/supervisor/conf.d/*.conf

According to the above snippet, the supervisorctl checks for files inside the conf.d directory.

There are two actions of choice you can take:

  1. Change the directory mentioned in the supervisord.conf to the main directory (/etc/supervisor) or a directory that you want to put the configuration files.
[include]
files = /etc/supervisor/*.conf
  1. Add the configuration files to the conf.d directory.

Either of these actions will work.

Gossipmonger answered 20/12, 2023 at 3:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.