-
Notifications
You must be signed in to change notification settings - Fork 90
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
[Solved] Reverb not dispatching events in production #117
Comments
I have tested this issue with the response #107 (comment) here, but this was not the solution. |
I have the same problem https://github.com/laravel/reverb/issues/112 here, seems its also pretty much the same conditions. Laravels Broadcasting system cannot connect to the reverb-server, still found no solution. |
I looked into your issue #112 but in this case no exception is thrown. I checked the logs and checked this with Telescope. |
I have tried to implement the solution of #107 (comment) with no success. Echo connects to Reverb and a subscribed message is logged in --debug but when a event is dispatched no socket messages are send in production, I have tried with queue:listen as well. These two issues seem related but are different. To me it seems that the issue is somewhere between Laravel Broadcast communicating with Reverb. But no exceptions or logs are made. What I noticed is that in Telescope there are 0 listeners. It feels unrelated but worth mentioning. This is the same for local as well as production. Is there still an experiment that I can conduct? |
Hi @WesWeCan, the backend routes for Reverb are prefixed with |
Hi @joedixon Thanks for your reply. But adding a /apps to NGINX doesn't do the trick.
Also leaving this here for people that stumble on this same problem in the future. |
I have the same type of issue. nothing was helpful. implementing web-sockets in production is like finding water in mars. All the possible ways i have tried.
if some one gives a proper setup or guide from start to end would help for production. in local it took only few minutes to implement. this is the same thing happened before launch of reverb. waiting nearly 6 months to implement in production |
What kind of environment are you using? |
@joedixon Okay! I figured it out. It is a really stupid thing that I missed since I was too much focussed on the Reverb side of this. Maybe you have the same oversight @amypo-tech? In short the issue was just a wrong .env config. In my production
but it should be
I am not sure if this is set by the install of reverb or that I did it locally. So for people that stumble upon this same issue (according to google, I'm not the only one). I always find it frustrating if there is no complete solution given when I google myself. in
For me in PLESK (apache + NGINX) Additional NGINX Directives:
Running the Reverb server automatically This may differ in your environment but this is now tested in Plesk AlmaLinux 8, PHP 8.3. All on your own risk form here!
When updating the |
@WesWeCan This fixed it for me. Thank you, you're a godsend! |
I am adding this to cloud admin but not working `server { {{nginx_access_log}} if ($scheme != "https") { location ~ /.well-known { {{settings}} location / {
location ~* ^.+.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { if (-f $request_filename) { server { try_files $uri $uri/ /index.php?$args; location ~ .php$ { location ~* ^.+.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { if (-f $request_filename) { |
for some reason, after switching from http to https, my pusher server does not broadcast the event, i've applied the configs as mentioned by WesWeCan, but its still the same. i've changed it to which then worked, the events are broadcasted and shown on client and in reverb console and with --debug (previously the clients did subscribe to the channel before the event was broadcasted, just to clarify) after doing some more checks, i couldn't figure out why the channel manager was returning empty channels array in the first place, and after reverting back to find() and restarting the reverb server, the events were still being broadcasted successfully. update : woops! i just realized that i wasn't subscribing to the same channel as the event previously! you need to make sure the channel the event broadcasts to is subscribed to by anything, before broadcasting the event! otherwise the event wouldn't even be broadcasted from EventDispatcher, and you wouldn't see anything on client side and on reverb console. |
Reverb Version
@beta (out of the box after install)
Laravel Version
11.0
PHP Version
8.3.4
Description
In a local environment (non herd) with
reverb:start
when a event is dispatched I get the message in my console log. But in production on a Plesk server it does not. No error messages or anything in the logs that seem to point at the solution.Steps To Reproduce
Create a new laravel installation, install broadcast.
local .env
production .env
In a controller:
The Event
On the front-end (works local but not in production)
On the server I have added 'additional nginx directives'
A connection on the front-end is made over wss://sub.domain.com/app/~~~~
In the debug of reverb I see a subscribe message to the channel:
But the event doesn't trigger the messages being send in production, but they do in local development.
It feels like that the Laravel Framework is not able to send the message to the Reverb server for unknown reasons.
The text was updated successfully, but these errors were encountered: