Laravel 4 Queue - [InvalidArgumentException] There are no commands defined in the “queue” namespace

99封情书 提交于 2020-01-07 03:39:47

问题


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.


回答1:


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.




回答2:


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"


来源:https://stackoverflow.com/questions/19062341/laravel-4-queue-invalidargumentexception-there-are-no-commands-defined-in-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!