laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.66k stars 11.04k forks source link

Error with Pusher Authentication Url since 11.10.0 upgrade #51726

Closed streamingsystems closed 5 months ago

streamingsystems commented 5 months ago

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.

crynobone commented 5 months ago

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.

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 so please include the configuration (related to broadcasting/pusher). Remember to use environment variables to avoid pushing the production keys to GitHub.

streamingsystems commented 5 months ago

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 installerhttps://github.com/laravel/installer in order to run this command. Please also make sure you have both Git & the GitHub CLI toolhttps://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 #51619https://github.com/laravel/framework/pull/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 GitHubhttps://github.com/laravel/framework/issues/51726#issuecomment-2152183200, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOI5PRIDBEFVU346CA2RAKLZGBD4DAVCNFSM6AAAAABI4QWLBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGE4DGMRQGA. You are receiving this because you authored the thread.Message ID: @.***>

streamingsystems commented 5 months ago

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',
        ],

    ],

];
Jubeki commented 5 months ago

@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.

streamingsystems commented 5 months ago

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:

Illuminate\Broadcasting\Broadcasters\Broadcaster

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:

[2024-06-09 10:10:54] local.DEBUG: Calling: getBindingCallback for channel with 1  
[2024-06-09 10:10:54] local.DEBUG: Illuminate\Routing\RouteBinding  
[2024-06-09 10:10:54] local.DEBUG: Method:forCallback  
[2024-06-09 10:10:54] local.DEBUG: Method:createClassBinding  
[2024-06-09 10:10:54] local.DEBUG: Method:forModel  
[2024-06-09 10:10:54] local.ERROR: Too few arguments to function Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters\{closure}(),

When I revert back to the previous version I see:

[2024-06-09 10:10:54] local.DEBUG: Calling: getBindingCallback for channel with 1  
[2024-06-09 10:10:54] local.DEBUG: Illuminate\Routing\RouteBinding  
[2024-06-09 10:10:54] local.DEBUG: Method:forCallback  
[2024-06-09 10:10:54] local.DEBUG: Method:createClassBinding  
[2024-06-09 10:10:54] local.DEBUG: Method:forModel  

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

crynobone commented 5 months ago

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.

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! 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.

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!

streamingsystems commented 5 months ago

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.

crynobone commented 5 months ago

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.

streamingsystems commented 5 months ago

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?

crynobone commented 5 months ago

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.

sedwardsgt commented 5 months ago

FWIW, I just updated to v11, and I am getting this exact same error out of the gate..

streamingsystems commented 5 months ago

@sedwardsgt Do you have an easy way to submit the request they are asking on how to reproduce it?

sedwardsgt commented 5 months ago

My app is pretty huge, but per the call stack, it starts in some middleware

class SentryContext
{
    /**
     * Handle an incoming request.
     *
     * @param  Request $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next): mixed
    {
        if (app()->bound('sentry') && $user = auth()->user()) {
            Sentry\configureScope(function (Sentry\State\Scope $scope) use ($user): void {
                $scope->setUser([
                    'id' => $user->_id,
                    'email' => $user->email,
                    'name' => $user->name,
                ]);
            });
        }

        return $next($request);
    }
}

and it chokes (in my case) in

    protected function extractAuthParameters($pattern, $channel, $callback)
    {
        $callbackParameters = $this->extractParameters($callback);

        return collect($this->extractChannelKeys($pattern, $channel))->reject(function ($value, $key) {
            return is_numeric($key);
        })->map(function ($value, $key) use ($callbackParameters) {
            return $this->resolveBinding($key, $value, $callbackParameters);
        })->values()->all();
    }

on the })->map(function ($value, $key) use ($callbackParameters) {

line. Here is the call stack
```[2024-06-11 15:28:54] local.ERROR: Too few arguments to function Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters\{closure}(), 1 passed and exactly 2 expected {"userId":"6605a2d04c25a1d83207fdd2","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/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php:145)
[stacktrace]
#0 [internal function]: Illuminate\\Broadcasting\\Broadcasters\\Broadcaster->Illuminate\\Broadcasting\\Broadcasters\\{closure}('6605a2e1a0ec3ac...')
#1 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(607): array_map(Object(Closure), Array)
#2 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(758): Illuminate\\Support\\Arr::map(Array, Object(Closure))
#3 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php(145): Illuminate\\Support\\Collection->map(Object(Closure))
#4 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php(115): Illuminate\\Broadcasting\\Broadcasters\\Broadcaster->extractAuthParameters('AccountModel.{a...', 'AccountModel.66...', 'App\\\\Broadcastin...')
#5 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(85): Illuminate\\Broadcasting\\Broadcasters\\Broadcaster->verifyUserCanAccessChannel(Object(Illuminate\\Http\\Request), 'AccountModel.66...')
#6 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php(523): Illuminate\\Broadcasting\\Broadcasters\\PusherBroadcaster->auth(Object(Illuminate\\Http\\Request))
#7 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(357): Illuminate\\Broadcasting\\BroadcastManager->__call('auth', Array)
#8 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php(24): Illuminate\\Support\\Facades\\Facade::__callStatic('auth', Array)
#9 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Illuminate\\Broadcasting\\BroadcastController->authenticate(Object(Illuminate\\Http\\Request))
#10 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction('authenticate', Array)
#11 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Broadcasting\\BroadcastController), 'authenticate')
#12 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(206): Illuminate\\Routing\\Route->runController()
#13 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#14 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#15 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#16 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#17 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(64): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#18 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'sanctum')
#19 /Users/sedwards/Sites/govtribe/web/app/Http/Middleware/SentryContext.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SentryContext->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'api')
#21 /Users/sedwards/Sites/govtribe/web/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful->Laravel\\Sanctum\\Http\\Middleware\\{closure}(Object(Illuminate\\Http\\Request))
#23 /Users/sedwards/Sites/govtribe/web/vendor/laravel/sanctum/src/Http/Middleware/AuthenticateSession.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Laravel\\Sanctum\\Http\\Middleware\\AuthenticateSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#29 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#30 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#31 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#32 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#33 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#34 /Users/sedwards/Sites/govtribe/web/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php(60): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#35 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(165): Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful->Laravel\\Sanctum\\Http\\Middleware\\{closure}(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /Users/sedwards/Sites/govtribe/web/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php(24): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#38 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#41 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#42 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#43 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#44 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#45 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#46 /Users/sedwards/Sites/govtribe/web/vendor/laravel/nova/src/Http/Middleware/ServeNova.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /Users/sedwards/Sites/govtribe/web/app/Http/Middleware/TransformRelationshipFieldSingleValues.php(85): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\TransformRelationshipFieldSingleValues->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#50 /Users/sedwards/Sites/govtribe/web/app/Http/Middleware/TransformRelationshipFieldMultipleValues.php(84): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#51 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\TransformRelationshipFieldMultipleValues->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /Users/sedwards/Sites/govtribe/web/app/Http/Middleware/ClearElasticaEngineBatchMiddleware.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\ClearElasticaEngineBatchMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#63 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#64 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#65 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#66 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#67 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#68 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#69 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#70 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#71 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#72 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#73 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#74 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#75 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#76 /Users/sedwards/Sites/govtribe/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#77 /Users/sedwards/Sites/govtribe/web/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#78 /Users/sedwards/.composer/vendor/laravel/valet/server.php(110): require('/Users/sedwards...')
#79 {main}
sedwardsgt commented 5 months ago

I rolled back to 11.9.2, and this error went away.

lucacri commented 4 months ago

I have a similar problem:

ArgumentCountError Too few arguments to function Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters\{closure}(), 1 passed and exactly 2 expected 
    vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php:145 Illuminate\Broadcasting\Broadcasters\Broadcaster::Illuminate\Broadcasting\Broadcasters\{closure}
    [internal] array_map
    vendor/laravel/framework/src/Illuminate/Collections/Arr.php:607 Illuminate\Support\Arr::map
    vendor/laravel/framework/src/Illuminate/Collections/Collection.php:759 Illuminate\Support\Collection::map
    vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php:145 Illuminate\Broadcasting\Broadcasters\Broadcaster::extractAuthParameters
    vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php:115 Illuminate\Broadcasting\Broadcasters\Broadcaster::verifyUserCanAccessChannel
    vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:85 Illuminate\Broadcasting\Broadcasters\PusherBroadcaster::auth
    vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php:523 Illuminate\Broadcasting\BroadcastManager::__call
    vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:357 Illuminate\Support\Facades\Facade::__callStatic
    vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php:24 Illuminate\Broadcasting\BroadcastController::authenticate
    vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54 Illuminate\Routing\Controller::callAction
    vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:43 Illuminate\Routing\ControllerDispatcher::dispatch
    vendor/laravel/framework/src/Illuminate/Routing/Route.php:260 Illuminate\Routing\Route::runController
    vendor/laravel/framework/src/Illuminate/Routing/Route.php:206 Illuminate\Routing\Route::run
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:806 Illuminate\Routing\Router::Illuminate\Routing\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50 Illuminate\Routing\Middleware\SubstituteBindings::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49 Illuminate\View\Middleware\ShareErrorsFromSession::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121 Illuminate\Session\Middleware\StartSession::handleStatefulRequest
    vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64 Illuminate\Session\Middleware\StartSession::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:75 Illuminate\Cookie\Middleware\EncryptCookies::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119 Illuminate\Pipeline\Pipeline::then
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:805 Illuminate\Routing\Router::runRouteWithinStack
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:784 Illuminate\Routing\Router::runRoute
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:748 Illuminate\Routing\Router::dispatchToRoute
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:737 Illuminate\Routing\Router::dispatch
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200 Illuminate\Foundation\Http\Kernel::Illuminate\Foundation\Http\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php:19 Livewire\Features\SupportDisablingBackButtonCache\DisableBackButtonCacheMiddleware::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/nova/src/Http/Middleware/ServeNova.php:23 Laravel\Nova\Http\Middleware\ServeNova::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31 Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51 Illuminate\Foundation\Http\Middleware\TrimStrings::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27 Illuminate\Http\Middleware\ValidatePostSize::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:110 Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:62 Illuminate\Http\Middleware\HandleCors::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:57 Illuminate\Http\Middleware\TrustProxies::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119 Illuminate\Pipeline\Pipeline::then
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175 Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144 Illuminate\Foundation\Http\Kernel::handle
    vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1183 Illuminate\Foundation\Application::handleRequest
    public/index.php:17 [main]

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.

ccharz commented 4 months ago

@crynobone I was able to reproduce the issue https://github.com/ccharz/bug-report/commit/3e354fe4e9eb0ec2b76a7765273f42f066338334

In my case, the problem only exists when there is a Route model binding (Route::model('order', Order::class)) in the channel route.

I think the problem was introduced when the forModel($container, $class, $callback = null) received the additional route parameter in https://github.com/laravel/framework/commit/4ebbabe4eb13870bb43767eefb7e04668b539aaf