Closed jksa closed 4 months ago
@jksa we pushed a fix for Valet yesterday. Could you maybe try the main branch by requesting "laravel/reverb":"@dev"
in your composer.json?
You'll need to remove all TLS options from your config to test.
Installed and removed all tls options. Same error.
Reverb version is now:
composer show -i laravel/reverb
name : laravel/reverb descrip. : Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications. keywords : WebSockets, laravel, real-time, websocket versions : * dev-main . . .
Hey @jksa I believe this is an issue with Curl on your local machine. If you can supply a repo reproducing the issue, I'm happy to test on my local machine. You can get started with the following command:
laravel new bug-report --github="--public"
Going to close this issue in the mean time.
Hi @joedixon , please feel free to test with my repo. Today I updated php & curl versions and still got same issue. Can you please inform me what cURL version you are using? I tried also with PHP8.3.6 but same error. Curl has version 8.4.0
Here is my env file:
This is how issue can be reproduced:
run reverb & queue worker
execute from tinker:
App\Events\TestEvent::dispatch();
Job will fail and you can find error from logs.
I am also having ssl issues. I believe its the same.
https://github.com/bretterer/reverb-ssl-test is my reproduction repo. I am using Laravel Herd instead of straight Valet, but its a secure domain.
I'm using:
Laravel 11.4.0
Laravel Installer 5.7.1
PHP 8.3.6
Herd 1.6.0
Reverb "laravel/reverb":"@dev"
Steps I took:
1: laravel new reverb-ssl
(No starterkit, pest)
2: enable ssl in herd for new site
3: update APP_URL in .env to include https
4: start reverb service on port 8080 on Herd
5: php artisan install:broadcasting
6: Create a test event SiteVisited
and update the PrivateChannel
name to site-visited
7: Implement ShouldBroadcast
in the new event
8: update routes/channel.php
Broadcast::channel('site-visit', function () {
return true;
});
9: edit web.php
route to include SiteVisited::broadcast()
(also tried dispatch
)
10: Add listener to echo.js
(Docs say I can use Echo.private
but says Echo
is undefined, need to use window.Echo
)
window.Echo.private('site-visit')
.listen('SiteVisted', function(e) {
console.log(e);
});
10: started npm run dev
11: started php artisan queue:work
Errors in console: WebSocket connection to 'wss://localhost:8080/app/e0bgxgxlni4u4wntyj2k?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed: WebSocket is closed before the connection is established.
As a note, I did the same configuration and steps without securing the website and using https
and it works fine.
@bretterer I think you need to set REVERB_HOST
and VITE_REVERB_HOST
to reverb-ssl.test
(or whatever your Herd secured site name is).
@joedixon, I tried that, and It does not change anything for me
@bretterer I have just tested your repo - you need to update your environment variables as follows:
REVERB_APP_ID=147395
REVERB_APP_KEY=e0bgxgxlni4u4wntyj2k
REVERB_APP_SECRET=vn7tuvmso5cmmlvz7uwg
- REVERB_HOST="localhost"
+ REVERB_HOST="reverb-ssl-test.test"
REVERB_PORT=8080
- REVERB_SCHEME=http
Using the correct hostname and removing the plaintext scheme which will use the https
default instead should resolve your issue.
@jksa I'm a Herd user so going to take me a little longer to test on Valet.
@jksa can you try updating the client_options
settings of the reverb
broadcaster in your broadcasting.php
configuration file as follows?
You won't want to do this in production so I would recommend making it an environment variable if it solves the issue.
'client_options' => [
'verify' => false,
],
@joedixon that really sounded promising, but unfortunately did not help.
That did resolve the problem for me. Can you share:
broadcasting.php
config filecomposer.json
fileREVERB_
prefixed environment variablesSure, here you go:
That all looks good to me.
Can you verify in your composer.lock which version of Reverb is being installed?
@joedixon Sadly, this is still an issue. Getting:
echo.js:6 WebSocket connection to 'wss://reverb-ssl.test:8080/app/e0bgxgxlni4u4wntyj2k?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed: WebSocket is closed before the connection is established.
(locally, i have reverb-ssl
as the folder in Herd)
I tried somethings around going to https://reverb-ssl.test:8080 as I am using Brave browser and it sounds like chrome has a cert issue, but nothing resolves at that url (i suspected that to be the case)
Would you like me to open a new issue, or do you think this is related? Were you able to get my example repo up and running using Herd and Herd Reverb service?
@bretterer this should be fixed on the main
branch - can you give that a try?
seems "laravel/reverb": "dev-main",
is still giving the same error
Here is my Herd
services
@bretterer the Reverb Herd service is separate and doesn't yet have TLS support.
Are you trying to use that or do you have Reverb installed in your application?
reverb is installed in my application. Let me try php artisan reverb:start
@joedixon Seems to be that. php artisan reverb:start
I no longer see the error in brave.
There are few items I would suggest for docs,
secure
yetwindow.Echo.
instead of just Echo
channels.php
route for this, as I personally am having issues using PrivateChannel
to test with
Broadcast::channel('site-visit', function () {
return true;
});
That gives a 403, but thats not for this ticket.
Thank you so much for the help!
That all looks good to me.
Can you verify in your composer.lock which version of Reverb is being installed?
Here you go!
Thanks @jksa - I went deeper into the rabbit hole today and think I came out with a solution.
Would you be able to give this PR a test: https://github.com/laravel/reverb/pull/167
@joedixon I am having the same problem. I forked reverb and applied your PR to my fork: https://github.com/vesper8/reverb
This made the problem go away for me. My broadcasting tests now work on localhost using Laravel Valet and SSL where previously they were failing with SSL_ERROR_SYSCALL
All of this is probably indeed related to openssl's new 3.3 release. A very similar thing happened when they released 3.2 back in November of last year.
Thanks for looking into it and providing a fix. Hope it gets merged soon.
Thanks @jksa - I went deeper into the rabbit hole today and think I came out with a solution.
Would you be able to give this PR a test: #167
@joedixon I'm more than happy to confirm that PR seem to fix my issue!!! Now dispatching events via work queue runs with out errors and browser receives events! Excellent!!! Thanks a lot for you efforts! Any ideas when this would be released?
I want to do a little more testing, but assuming all goes well, I think it's likely we can get a new release out pretty soon.
Reverb Version
1.0.0-beta7
Laravel Version
11.4.0
PHP Version
8.2.16
Description
I have struggled to get laravel reverb work locally with valet & ssl & Livewire.
I can get Echo successfully connet to reverb, but when dispatching event, I get error:
[2024-04-19 10:17:12] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0
Steps To Reproduce
I use node version 20.10. Valet version: 4.6.1
Change from .env: APP_URL=https://reverb-app.test REVERB_HOST="reverb-app.test" REVERB_SCHEME=https
Set reverb.cong tls option to:
Create TestEvent for broadcasting: php artisan make:event TestEvent Edit TestEvet to implement ShouldBroadcast and chane PrivateChannel to Channel
Start parallel: npm run dev php artisan reverb:start --debug php artisan queue:work
Check browser connects successfully and reverb debug shows connection.
Dispatch event from tinker:
App\Events\TestEvent::dispatch();
See error from logs: [2024-04-19 10:48:14] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0
Full trace
[2024-04-19 10:48:14] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://reverb-app.test:8080/apps/835917/events?auth_key=bkefoajmyavya3ph3lml&auth_timestamp=1713523694&auth_version=1.0&body_md5=290a36791f069f26dc79082e40601c21&auth_signature=ff9d675c3f35a20b31e8dc9d106d3d6dd8f9208749641316f0be6c9aca044b8f {"exception":"[object] (GuzzleHttp\\Exception\\RequestException(code: 0): cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://reverb-app.test:8080/apps/835917/events?auth_key=bkefoajmyavya3ph3lml&auth_timestamp=1713523694&auth_version=1.0&body_md5=290a36791f069f26dc79082e40601c21&auth_signature=ff9d675c3f35a20b31e8dc9d106d3d6dd8f9208749641316f0be6c9aca044b8f at /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:211) [stacktrace] #0 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\\Handler\\CurlFactory::createRejection(Object(GuzzleHttp\\Handler\\EasyHandle), Array) #1 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\\Handler\\CurlFactory::finishError(Object(GuzzleHttp\\Handler\\CurlHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory)) #2 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(47): GuzzleHttp\\Handler\\CurlFactory::finish(Object(GuzzleHttp\\Handler\\CurlHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory)) #3 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\\Handler\\CurlHandler->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #4 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\\Handler\\Proxy::GuzzleHttp\\Handler\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #5 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(64): GuzzleHttp\\Handler\\Proxy::GuzzleHttp\\Handler\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #6 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #7 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #8 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Middleware.php(63): GuzzleHttp\\RedirectMiddleware->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #9 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #10 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\\HandlerStack->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #11 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\\Client->transfer(Object(GuzzleHttp\\Psr7\\Request), Array) #12 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\\Client->requestAsync('POST', Object(GuzzleHttp\\Psr7\\Uri), Array) #13 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/ClientTrait.php(95): GuzzleHttp\\Client->request('POST', 'apps/835917/eve...', Array) #14 /Users/juser/code/reverb-app/vendor/pusher/pusher-php-server/src/Pusher.php(776): GuzzleHttp\\Client->post('apps/835917/eve...', Array) #15 /Users/juser/code/reverb-app/vendor/pusher/pusher-php-server/src/Pusher.php(441): Pusher\\Pusher->post('/apps/835917/ev...', '{\"name\":\"App\\\\\\\\E...') #16 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(161): Pusher\\Pusher->trigger(Array, 'App\\\\Events\\\\Test...', Array, Array) #17 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(237): Illuminate\\Broadcasting\\Broadcasters\\PusherBroadcaster->Illuminate\\Broadcasting\\Broadcasters\\{closure}(Object(Illuminate\\Support\\Collection), 0) #18 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(160): Illuminate\\Support\\Collection->each(Object(Closure)) #19 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(92): Illuminate\\Broadcasting\\Broadcasters\\PusherBroadcaster->broadcast(Object(Illuminate\\Support\\Collection), 'App\\\\Events\\\\Test...', Array) #20 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Broadcasting\\BroadcastEvent->handle(Object(Illuminate\\Broadcasting\\BroadcastManager)) #21 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #22 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure)) #23 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure)) #24 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL) #25 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array) #26 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #27 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #28 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #29 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(124): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Illuminate\\Broadcasting\\BroadcastEvent), false) #30 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #31 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #32 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #33 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(71): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(Illuminate\\Broadcasting\\BroadcastEvent)) #34 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\\Queue\\CallQueuedHandler->call(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Array) #35 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\\Queue\\Jobs\\Job->fire() #36 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\\Queue\\Worker->process('database', Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(Illuminate\\Queue\\WorkerOptions)) #37 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\\Queue\\Worker->runJob(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), 'database', Object(Illuminate\\Queue\\WorkerOptions)) #38 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(139): Illuminate\\Queue\\Worker->daemon('database', 'default', Object(Illuminate\\Queue\\WorkerOptions)) #39 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(122): Illuminate\\Queue\\Console\\WorkCommand->runWorker('database', 'default') #40 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle() #41 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #42 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure)) #43 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure)) #44 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL) #45 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(212): Illuminate\\Container\\Container->call(Array) #46 /Users/juser/code/reverb-app/vendor/symfony/console/Command/Command.php(279): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #47 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #48 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(1049): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #49 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(318): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #50 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(169): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #51 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(196): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #52 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1183): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #53 /Users/juser/code/reverb-app/artisan(13): Illuminate\\Foundation\\Application->handleCommand(Object(Symfony\\Component\\Console\\Input\\ArgvInput)) #54 {main} "}