6696

Starting supervisorctl gives ERROR (spawn error) on laravel queue worker process

Question:

So i have installed supervisor and it appears to be running. I have placed my config file for the queue worker in /etc/supervisor/conf.d/laravel-worker.conf

And it looks like this

[program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html queue:work database --sleep=3 --tries=2 --daemon autostart=true autorestart=true numprocs=4 redirect_stderr=true stdout_logfile=/var/www/html/storage/logs/laravel.log

And my supervisord.conf looks like this

[unix_http_server] file=/var/run/supervisor.sock ; (the path to the socket file) chmod=0775 ; sockef file mode (default 0700) chown=root [supervisord] logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) ; the below section must remain in the config file for RPC ; (supervisorctl/web interface) to work, additional interfaces may be ; added by defining them in separate rpcinterface: sections [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket ; The [include] section can just contain the "files" setting. This ; setting can list multiple files (separated by whitespace or ; newlines). It can also contain wildcards. The filenames are ; interpreted as relative to this file. Included files *cannot* ; include files themselves. [include] files = /etc/supervisor/conf.d/*.conf

I am getting the error - ERROR (spawn error) when i attempt to start the processes.

When i look at the log file it shows -

2017-05-28 22:21:20,697 INFO exited: laravel-worker_01 (exit status 0; not expected) 2017-05-28 22:21:20,702 INFO exited: laravel-worker_00 (exit status 0; not expected) 2017-05-28 22:21:20,704 INFO exited: laravel-worker_02 (exit status 0; not expected) 2017-05-28 22:21:20,706 INFO exited: laravel-worker_03 (exit status 0; not expected) 2017-05-28 22:21:23,711 INFO spawned: 'laravel-worker_00' with pid 16280 2017-05-28 22:21:23,713 INFO spawned: 'laravel-worker_01' with pid 16281 2017-05-28 22:21:23,715 INFO spawned: 'laravel-worker_02' with pid 16282 2017-05-28 22:21:23,719 INFO spawned: 'laravel-worker_03' with pid 16283 2017-05-28 22:21:23,772 INFO exited: laravel-worker_02 (exit status 0; not expected) 2017-05-28 22:21:23,774 INFO gave up: laravel-worker_02 entered FATAL state, too many start retries too quickly 2017-05-28 22:21:23,774 INFO exited: laravel-worker_01 (exit status 0; not expected) 2017-05-28 22:21:23,776 INFO gave up: laravel-worker_01 entered FATAL state, too many start retries too quickly 2017-05-28 22:21:23,776 INFO exited: laravel-worker_03 (exit status 0; not expected) 2017-05-28 22:21:23,777 INFO gave up: laravel-worker_03 entered FATAL state, too many start retries too quickly 2017-05-28 22:21:23,777 INFO exited: laravel-worker_00 (exit status 0; not expected) 2017-05-28 22:21:24,778 INFO gave up: laravel-worker_00 entered FATAL state, too many start retries too quickly

I have verified that all the files in my config file exist. I am not sure i am using the right configuration in my laravel-worker.conf. I have searched documentation and other stackoverflow threads but could not find the solution

Answer1:

So the problem apparently was with my laravel-worker I needed to complete command path by adding '/artisan' to the path like so -

[program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/artisan queue:work database --sleep=3 --tries=2 --daemon

Answer2:

you need add artisan in your conf and add user in your conf file

for example

[program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /home/site.com/kernel/artisan queue:work --sleep=3 -- tries=3 autostart=true autorestart=true user=root numprocs=10 redirect_stderr=true stdout_logfile=/home/site.com/kernel/worker.log

Recommend

  • Sidekiq server not loading configuration file
  • how to install php7 (zts) + pthreads on Ubuntu 14.04
  • Force stop celery workers running as a systemd service
  • How To Get The Root Directory Of an Elixir Project
  • Why I can not use disposable objects in object members?
  • Bash script hangs
  • Poor performance when writing large XML-based log file
  • java socket timeout behaviour
  • Why do I need to force git to sync my remote repository?
  • Zookeeper -Kafka: ConnectException - Connection refused
  • mysql_* to MySQLi
  • starttls on node.js > 0.4.0
  • Why does cpu load not change more than a few hundredths?
  • “Permission denied” while connecting to a page, even with INTERNET permission
  • Reconnection in socket.io problem in `socket.on('message',function(){})`
  • subprocess.Popen: 'OSError: [Errno 13] Permission denied' only on Linux
  • inter thread comunication using ZeroMQ messages [closed]
  • synology php ftp_ssl_connect - Call to undefined function
  • How to send an std::vector of unsigned char over an UDP socket using boost asio?
  • How to read data from socket connection - android
  • Cannot send user message with Spring Websocket
  • Is there a way to get the process ID of a console program I've just started in the background?
  • Find VMID for running instance
  • Error in making a socket connection
  • Spark (Scala) Writing (and reading) to local file system from driver
  • rewrite uppercase url to lowercase url htaccess
  • htaccess add www if not subdomain, if subdomain remove www
  • Jackson Parser: ignore deserializing for type mismatch
  • Change multiple background-images with jQuery
  • Jenkins: How To Build multiple projects from a TFS repository?
  • output of program is not same as passed argument
  • Trying to switch camera back to front but getting exception
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Upload files with Ajax and Jquery
  • Akka Routing: Reply's send to router ends up as dead letters
  • AngularJs get employee from factory
  • Proper way to use connect-multiparty with express.js?
  • unknown Exception android
  • Checking variable from a different class in C#
  • How can i traverse a binary tree from right to left in java?