-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Error with Pusher Authentication Url since 11.10.0 upgrade #51726
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! I believe the issue may be related to #51619 so please include the configuration (related to broadcasting/pusher). Remember to use environment variables to avoid pushing the production keys to GitHub. |
Hi,
I have never done what you have requested below. Will this somehow share my entire code base with the public? (of course I don’t want to do that)
I am little unclear on what the below does.
For what it’s worth, as far as configuration files my Laravel app was created with Laravel 6 (I have been keeping up with all major and minor versions the day the come out).
So in my config directory I do have all of the separate configuration files like broadcasting.php.
From: Mior Muhammad Zaki ***@***.***>
Date: Thursday, June 6, 2024 at 6:47 AM
To: laravel/framework ***@***.***>
Cc: streamingsystems ***@***.***>, Author ***@***.***>
Subject: Re: [laravel/framework] Error with Pusher Authentication Url since 11.1.0 upgrade (Issue #51726)
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer<https://github.com/laravel/installer> in order to run this command. Please also make sure you have both Git & the GitHub CLI tool<https://cli.github.com/> properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
…________________________________
I believe the issue may be related to #51619<#51619> so please include the configuration (related to broadcasting/pusher). Remember to use environment variables to avoid pushing the production keys to GitHub.
—
Reply to this email directly, view it on GitHub<#51726 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOI5PRIDBEFVU346CA2RAKLZGBD4DAVCNFSM6AAAAABI4QWLBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGE4DGMRQGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
My broadcasting.php file looks like this: <?php
return [
'default' => env('BROADCAST_DRIVER', 'websocket'),
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => credentials('PUSHER_APP_KEY'),
'secret' => credentials('PUSHER_APP_SECRET'),
'app_id' => credentials('PUSHER_APP_ID'),
'options' => [
'cluster' => credentials('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
],
'websocket' => [
'driver' => 'websocket',
'key' => credentials('PUSHER_APP_KEY'),
'secret' => credentials('PUSHER_APP_SECRET'),
'app_id' => credentials('PUSHER_APP_ID'),
'options' => [
'useTLS' => false,
'host' => env('BROADCAST_HOST'),
'port' => env('BROADCAST_PORT', 80),
'scheme' => 'http'
],
],
'redis' => [
'driver' => env('REDIS_DRIVER', 'redis-sentinel'),
'connection' => 'queue',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
]; |
@streamingsystems what he is asking for is a minimal reproduction repository. You don't need to share your whole code base. Only an example where the problem occurs. |
Hi All, I wanted to share more debugging so hopefully someone can help me determine what in this latest version changed to cause this issue. I am still working on getting something that I can commit to reproduce but I wanted to first spend some time sharing the info I found this morning while testing. As mentioned, when I go back to 11.9.2 it works perfectly. The way I am setting up my broadcast channel is: Broadcast::channel('tenant.{tenant}.channel.{channel}', Channel::class); I have tracked the problem down to this class:
Specifically this method: protected function resolveExplicitBindingIfPossible($key, $value)
{
$binder = $this->binder();
if ($binder && $binder->getBindingCallback($key)) {
return call_user_func($binder->getBindingCallback($key), $value);
}
return $value;
} It seems like the call_user_func is expecting different parameters after this upgrade. Or somehow something is being resolved differently in the system and maybe a different callback is being called or something. I am at the edge of what I understand about the underpinnings of the Laravel framework. I put some Reflection code in if this helps: protected function resolveExplicitBindingIfPossible($key, $value)
{
$binder = $this->binder();
if ($binder && $binder->getBindingCallback($key)) {
$callback = $binder->getBindingCallback($key);
Log::debug("Calling: getBindingCallback for $key with $value");
$reflectionClosure = new \ReflectionFunction($callback);
Log::debug($reflectionClosure->getClosureScopeClass()->getName());
$methods = $reflectionClosure->getClosureScopeClass()->getMethods();
foreach ($methods as $method) {
Log::debug("Method:" . $method->getName());
}
return call_user_func($binder->getBindingCallback($key), $value);
}
return $value;
} When I run it I get:
When I revert back to the previous version I see:
But I don't get the error, and it zips right through and the broadcasting works great. As you can guess, with the latest version when I get this error the broadcasting fails. Any help would be greatly appreciated :) -Rob |
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Hi, It seems like the reply I got is some type of auto responder as it's exactly the same reply as the first, and after that I provided more information. I am curious if anyone can take a look at my reply and point me in a direction? Something changed in the latest update that broken my Laravel that has been working for 3+ years but based on the change log I can't determine what might have done it. |
Something broke your application but not everyone else. Now in order for anyone else to understand the issue we need to replicate it and you are the only one that can provide it. |
Our system is vast so I am trying to figure out how I can submit a use case that will allow you to reproduce it without submitting our entire system. Based on the information I provided yesterday: Does anyone know in this method for the Broadcaster class: resolveExplicitBindingIfPossible: return call_user_func($binder->getBindingCallback($key), $value); What is this doing? In other words what callback is it looking up? This is how I defined the Channel class as it relates to broadcasting: Broadcast::channel('tenant.{tenant}.channel.{channel}', Channel::class); I can help as best I can (I don't expect others to solve this for me) I just don't understand what "callback" resolveExplicitBindingIfPossible is calling? |
Hey there, While this may be a legitimate issue, can you first try posting your problem or question on one of the support channels below? If this issue can be definitively identified as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out. Thanks! Would be happy to reopen this issue once reproducing code can be submitted. |
FWIW, I just updated to v11, and I am getting this exact same error out of the gate.. |
@sedwardsgt Do you have an easy way to submit the request they are asking on how to reproduce it? |
My app is pretty huge, but per the call stack, it starts in some middleware
and it chokes (in my case) in
on the
|
I rolled back to |
I have a similar problem:
My codebase is also pretty big, upgrading all the way from Laravel 4. All was working on 10.x, and I assume also in <11.10 since I am just now getting reports from our clients. |
@crynobone I was able to reproduce the issue ccharz/bug-report@3e354fe In my case, the problem only exists when there is a Route model binding ( I think the problem was introduced when the |
Laravel Version
11.10.0
PHP Version
8.3.8
Database Driver & Version
No response
Description
Hi Laravel Team,
I upgrade from 11.9.2 to 11.10.0 and I am now hitting an error. I tried to troubleshoot it this morning but could not figure it out.
I reverted back to 11.9.2 and it's working correctly so this makes me think something was changed in 11.10.0 that would affect this.
I am using pusher and authenticating using this URL that has been working for years:
https://mydomain.com/broadcasting/auth
All of a sudden after this upgrade my the auth url is failing with 500 error. In my logs I see:
[2024-06-06 06:14:39] local.ERROR: Too few arguments to function Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters{closure}(), 1 passed and exactly 2 expected {"userId":"1_161_741","exception":"[object] (ArgumentCountError(code: 0): Too few arguments to function Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters\{closure}(), 1 passed and exactly 2 expected at /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php:145)
[stacktrace]
#0 [internal function]: Illuminate\Broadcasting\Broadcasters\Broadcaster->Illuminate\Broadcasting\Broadcasters\{closure}('Dp4axOXD0JEoRu6...')
#1 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(607): array_map(Object(Closure), Array)
#2 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(758): Illuminate\Support\Arr::map(Array, Object(Closure))
#3 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php(145): Illuminate\Support\Collection->map(Object(Closure))
#4 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php(115): Illuminate\Broadcasting\Broadcasters\Broadcaster->extractAuthParameters('tenant.{tenant}...', 'tenant.Dp4axOXD...', 'App\\Broadcastin...')
#5 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(85): Illuminate\Broadcasting\Broadcasters\Broadcaster->verifyUserCanAccessChannel(Object(Illuminate\Http\Request), 'tenant.Dp4axOXD...')
#6 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php(523): Illuminate\Broadcasting\Broadcasters\PusherBroadcaster->auth(Object(Illuminate\Http\Request))
#7 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(357): Illuminate\Broadcasting\BroadcastManager->__call('auth', Array)
#8 /Users/rob/code/application/app/Http/Controllers/BroadcastController.php(17): Illuminate\Support\Facades\Facade::__callStatic('auth', Array)
#9 /Users/rob/code/application/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\BroadcastController->authenticate(Object(Illuminate\Http\Request))
....
Thanks!
-Rob
Steps To Reproduce
Use pusher and call your own auth url as I am doing above.
The text was updated successfully, but these errors were encountered: