Question

I'm using Laravel 4 + Beanstalk + Supervisor on a CentOS 6 VPS.

It was already a pain to install both beanstalk and supervisor on the VPS, but I got through it (I have done this same installation on my local server, a Macbook Pro, and it's working fine there).

I want to take advantage of Laravel 4's Queues and Beanstalk to send email asynchronously. I have made a "program" for supervisor that basically runs the command

php artisan queue:listen --env=production

but the process associated to that won't start succesfully. The log I defined for this process outputs the following:

[InvalidArgumentException]
There are no commands defined in the "queue" namespace.

So apparently artisan is finding something that it doesn't like at all.

Please, please, PLEASE, would you help me? Only results I've found on Google are an unanswered git issue post, and an equally useless thread with no answers on Laravel's forums.

Edit: Testing I've noticed that Artisan's queue:listen works fine when run by me in the shell, but when Supervisord tries to run the command, the InvalidArgumentException happens.

Was it helpful?

Solution

The solution in my case, if any one of you ever come across this issue, was the following:

I had supervisord version 2.1 installed (via pip). I needed at least version 3.0 (because the "directory" setting (used in the supervisord.conf file) was introduced in the version 3.0.

I had to

pip uninstall supervisor

Then I had to

pip install supervisor==3.0

After that, I just had to set the desired configuration values in /etc/supervisord.conf, and my artisan was running queue:listen without problems.

OTHER TIPS

I had similar problem and got my answer to the question I posted that worked for me:

Supervisord makes my Laravel queue:listen throw InvalidArgumentException

Instead of doing:

[program:lvcartsey]
command=php artisan queue:listen --env="local"
stdout_logfile=/home/mike/web/app/storage/logs/myqueue_supervisord.log
redirect_stderr=true
directory=/home/mike/web
;autorestart=true
;autostart=true
user=mike

in the supervisor.conf i replaced the command with:

command=/usr/local/bin/php artisan queue:listen --env="local"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top