Search code examples
laravelsupervisord

Laravel choses wrong queue connection


I've been developing a system for about 2 months now without any problems. However, now when it's time for launch, I did setup a dedicated server and started installing everything that was needed. However, when I came to settung up supervisor, things got ugly.

In my .env file I got this setting:

QUEUE_CONNECTION=database

However, when starting supervisor, I get this error:

{
"class": "Error",
"message": "Class 'Aws\\Sqs\\SqsClient' not found",
"code": 0,
"file": "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php:26",
"trace": [
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:157",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:138",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:145",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:116",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:100",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Container/Util.php:40",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:610",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php:136",
    "/var/www/brevia-laravel/vendor/symfony/console/Command/Command.php:256",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php:121",
    "/var/www/brevia-laravel/vendor/symfony/console/Application.php:971",
    "/var/www/brevia-laravel/vendor/symfony/console/Application.php:290",
    "/var/www/brevia-laravel/vendor/symfony/console/Application.php:166",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Console/Application.php:93",
    "/var/www/brevia-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129",
    "

I've tried to do cache:clear and config:clear, but still the worker thinks that I want to run the SqsQueue and not the database-queue... Tried looking around but can't find anyone with a similar problem.

I'm running Ubuntu 18.04 and PHP 7.3.26

EDIT

Running the command:

php artisan queue:work

works, so the problem might be the supervisor setup...


Solution

  • Found the error. When I started the supervisor it turns out that I had put the wrong flag by misstake. This forced the worker to run AWS instead of the setting in the .env