Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pusher error: error code: 502. #266

Closed
jessedewild opened this issue Oct 28, 2024 · 3 comments
Closed

Pusher error: error code: 502. #266

jessedewild opened this issue Oct 28, 2024 · 3 comments

Comments

@jessedewild
Copy link

Reverb Version

1.1.0

Laravel Version

10.48.20

PHP Version

8.2

Description

I am running Laravel Reverb on my Kubernetes cluster behind Cloudflare. Sometimes, the backend reports the following issue:

Pusher error: error code: 502.

I am using Laravel Echo in my Angular application to connect to Laravel Reverb.

This is the stacktrace:

in /var/www/html/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php line 164
at Illuminate\Broadcasting\Broadcasters\PusherBroadcaster->broadcast()in /var/www/html/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php line 92
at Illuminate\Broadcasting\BroadcastEvent->handle()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 36
at Illuminate\Container\BoundMethod->Illuminate\Container\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php line 41
at Illuminate\Container\Util->unwrapIfClosure()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 93
at Illuminate\Container\BoundMethod->callBoundMethod()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 35
at Illuminate\Container\BoundMethod->call()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php line 662
at Illuminate\Container\Container->call()in /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php line 128
at Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php line 144
at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php line 119
at Illuminate\Pipeline\Pipeline->then()in /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php line 132
at Illuminate\Bus\Dispatcher->dispatchNow()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php line 123
at Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php line 144
at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php line 119
at Illuminate\Pipeline\Pipeline->then()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php line 122
at Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php line 70
at Illuminate\Queue\CallQueuedHandler->call()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php line 102
at Illuminate\Queue\Jobs\Job->fire()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php line 439
at Illuminate\Queue\Worker->process()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php line 389
at Illuminate\Queue\Worker->runJob()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php line 176
at Illuminate\Queue\Worker->daemon()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php line 137
at Illuminate\Queue\Console\WorkCommand->runWorker()in /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php line 120
at Illuminate\Queue\Console\WorkCommand->handle()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 36
at Illuminate\Container\BoundMethod->Illuminate\Container\{closure}()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php line 41
at Illuminate\Container\Util->unwrapIfClosure()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 93
at Illuminate\Container\BoundMethod->callBoundMethod()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php line 35
at Illuminate\Container\BoundMethod->call()in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php line 662
at Illuminate\Container\Container->call()in /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php line 211
at Illuminate\Console\Command->execute()in /var/www/html/vendor/symfony/console/Command/Command.php line 326
at Symfony\Component\Console\Command\Command->run()in /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php line 180
at Illuminate\Console\Command->run()in /var/www/html/vendor/symfony/console/Application.php line 1096
at Symfony\Component\Console\Application->doRunCommand()in /var/www/html/vendor/symfony/console/Application.php line 324
at Symfony\Component\Console\Application->doRun()in /var/www/html/vendor/symfony/console/Application.php line 175
at Symfony\Component\Console\Application->run()in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php line 201
at Illuminate\Foundation\Console\Kernel->handle()in /var/www/html/artisan line 35

Steps To Reproduce

Run a broadcasting event.

@crynobone
Copy link
Member

Can you share the full errors?

https://github.com/laravel/framework/blob/646520ad682d98b5211c6e26092259cfbe130b5c/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php#L163-L166 Indicate that it unable to broadcast the event, this feels like a usage issue.

@jessedewild
Copy link
Author

jessedewild commented Oct 29, 2024

Is it possible to set a different REVERB_HOST for internal and the external? For example, I have set it to:

ws.jessedewild.com

But I am hosting it on a Kubernetes server, which (for example) uses the internal IP 10.0.0.1.

In the reverb.php and broadcasting.php you can set the 'REVERB_HOST'

@joedixon
Copy link
Collaborator

In broadcasting.php, you should set it to the location you need your app to broadcast your messages to. In reverb.php, it's used to set the hostname of the Reverb server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants