Hard to provide the right information for this. Been at it for days. I have Pusher working well in Vagrant. I stand it up with a basic Horizon config (prod/local doesn't matter):
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => [
env('DEFAULT_QUEUE', 'default'),
env('COMMENT_EVENT_QUEUE', 'comms')
],
'balance' => 'auto',
'processes' => 10,
'tries' => 3,
],
All of this is behind Stancl Tenancy for Laravel. And it all works works fine. I have stood up the exact same system on a production box. That works fine too.
I have now installed same in a business that complicates things with a load balancer and SSL on top. So my box sees only http traffic in the last mile. I use \URL::forceScheme('https');
in boot to make everything play nice, and it works.
I start Horizon from Supervisor using this conf file:
[program:horizon]
process_name=%(program_name)s
startsecs=0
command=php /var/www/er2/artisan horizon
user=www-data
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/www/er2/storage/logs/horizon.log
stopwaitsecs=3600
Problem:
Running Horizon (or queue:work) through supervisor FAILS to send pusher msgs with the following error:
{"exception":"[object] (Illuminate\Broadcasting\BroadcastException(code: 0): at /var/www/crisis/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:121)
Here's the kicker: if I start Horizon (or queue:work) from the command line, it works. It is only when I start it with Supervisor that it fails.
Anyone have an idea where to start?
What I've tried:
- Changing users in Supervisor -- still fails
- Changing Supervisor to start queue -- Still fails
- Changing to root on command line -- still works
- Changing workers -- still fails if Supervisor
- A bunch more but nothing makes a difference.
Dumping vars all over the vendor files, the only difference I can find is:
With Supervisor (fail):
RESPONSE --> {"body":false,"status":0}
With Command Line (success):
RESPONSE --> {"body":"{}","status":200}
I can't narrow down what is different for Pusher when Horizon is started from Supervisor vs command line. Any thoughts?