To debug and resolve the issue with Laravel Horizon not showing active queues on your worker server, you can follow these steps:
-
Check Horizon Status: First, ensure that Horizon is running on your worker server. You can do this by SSHing into your worker server and running the following command:
php artisan horizon:statusThis command will tell you if Horizon is running or not. If it's not running, you can start it with:
php artisan horizon -
Verify Supervisor Configuration: If you're using Supervisor to manage Horizon, ensure that your Supervisor configuration is correct. You should have a configuration file for Horizon, typically located at
/etc/supervisor/conf.d/horizon.conf. It should look something like this:[program:horizon] process_name=%(program_name)s command=php /path/to/your/project/artisan horizon autostart=true autorestart=true user=youruser redirect_stderr=true stdout_logfile=/path/to/your/project/storage/logs/horizon.logAfter making any changes, reload Supervisor:
sudo supervisorctl reread sudo supervisorctl update sudo supervisorctl start horizon -
Check .env Configuration: Ensure that your
.envfile on the worker server has the correct queue connection settings. It should be set to use Redis:QUEUE_CONNECTION=redis -
Network and Redis Configuration: Make sure that your Redis server is accessible from the worker server. You can test this by using a Redis client to connect to the Redis server from the worker server. Also, verify that the Redis configuration in your
.envfile is correct, including the host, port, and password if applicable. -
Check Logs: Look at the logs for any errors. You can check the Laravel logs located in
storage/logs/laravel.logand the Horizon logs specified in your Supervisor configuration. -
Telescope Monitoring: Since you mentioned using Telescope, ensure that Telescope is correctly configured and running. It can provide insights into what jobs are being dispatched and their status.
-
Firewall and Security Groups: Ensure that there are no firewall rules or security group settings blocking communication between your servers, especially between the worker server and the Redis server.
By following these steps, you should be able to identify and resolve the issue with Horizon not showing active queues on your worker server. If the problem persists, consider checking the Laravel and Horizon documentation for any additional troubleshooting steps.