Home > OS >  Can’t run artisan worker
Can’t run artisan worker

Time:04-16

I am trying to make api and app work together on the server, I can get on the api site from browser. To make app communicate with this api i need to queue worker by command:

php artisan queue:listen –queue=broadcast-queue

But when I do, I get an exception:

  The [–queue=broadcast-queue] queue connection has not been configured.

  at vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:159
    155▕     {
    156▕         $config = $this->getConfig($name);
    157▕ 
    158▕         if (is_null($config)) {
  ➜ 159▕             throw new InvalidArgumentException("The [{$name}] queue connection has not been configured.");
    160▕         }
    161▕ 
    162▕         return $this->getConnector($config['driver'])
    163▕                         ->connect($config)

       17 vendor frames 
  18  artisan:37
      Illuminate\Foundation\Console\Kernel::handle() 

I tried to google this exception, but it seems i am first to get this. I did run these commands without problem:

php artisan passport:install
php artisan key:generate
php artisan migrate
php artisan db:seed

CodePudding user response:

Laravel doesn't seem to find any queue connection...

have you done these?

php artisan queue:table

then check your .env file

QUEUE_CONNECTION=sync

should be

QUEUE_CONNECTION=database

otherwise I think you have specified a queue connection and you haven't configured it properly.

Post your queue implementation so I can be more informed about what you did.

CodePudding user response:

It was a typo it should be: php artisan queue:listen -–queue=broadcast-queue

  • Related