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

[2020-05-13 11:36:29] local.ERROR: Typed property Spatie\WebhookClient\ProcessWebhookJob::$webhookCall must not be accessed before initialization {"exception":"[object] (Error(code: 0): Typed property Spatie\\WebhookClient\\ProcessWebhookJob::$webhookCall must not be accessed before initialization at #62

Closed
darshanadaptit opened this issue May 13, 2020 · 1 comment

Comments

@darshanadaptit
Copy link

Hello Spatie team, I am using your package and really find it great, it works perfectly in laravel 6 , When I run from server client gives below error, all of my webhook calls throw this error, that is why I am a bit puzzled, what does this mean? How could I fix it? Missing something?

[2020-05-13 11:36:29] local.ERROR: Typed property Spatie\WebhookClient\ProcessWebhookJob::$webhookCall must not be accessed before initialization {"exception":"[object] (Error(code: 0): Typed property Spatie\WebhookClient\ProcessWebhookJob::$webhookCall must not be accessed before initialization at C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\SerializesModels.php:133)
[stacktrace]
#0 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\SerializesModels.php(133): ReflectionProperty->getValue(Object(App\Handler\WebHooksHandler))
#1 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\SerializesModels.php(77): Spatie\WebhookClient\ProcessWebhookJob->getPropertyValue(Object(ReflectionProperty))
#2 [internal function]: Spatie\WebhookClient\ProcessWebhookJob->__serialize()
#3 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\Queue.php(147): serialize(Object(App\Handler\WebHooksHandler))
#4 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\Queue.php(116): Illuminate\Queue\Queue->createObjectPayload(Object(App\Handler\WebHooksHandler), NULL)
#5 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\Queue.php(94): Illuminate\Queue\Queue->createPayloadArray(Object(App\Handler\WebHooksHandler), NULL, '')
#6 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Queue\SyncQueue.php(38): Illuminate\Queue\Queue->createPayload(Object(App\Handler\WebHooksHandler), NULL, '')
#7 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(182): Illuminate\Queue\SyncQueue->push(Object(App\Handler\WebHooksHandler))
#8 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(158): Illuminate\Bus\Dispatcher->pushCommandToQueue(Object(Illuminate\Queue\SyncQueue), Object(App\Handler\WebHooksHandler))
#9 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(73): Illuminate\Bus\Dispatcher->dispatchToQueue(Object(App\Handler\WebHooksHandler))
#10 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Bus\PendingDispatch.php(134): Illuminate\Bus\Dispatcher->dispatch(Object(App\Handler\WebHooksHandler))
#11 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(391): Illuminate\Foundation\Bus\PendingDispatch->__destruct()
#12 C:\inetpub\wwwroot\ableauth\vendor\spatie\laravel-webhook-client\src\WebhookProcessor.php(62): dispatch(Object(App\Handler\WebHooksHandler))
#13 C:\inetpub\wwwroot\ableauth\vendor\spatie\laravel-webhook-client\src\WebhookProcessor.php(34): Spatie\WebhookClient\WebhookProcessor->processWebhook(Object(Spatie\WebhookClient\Models\WebhookCall))
#14 C:\inetpub\wwwroot\ableauth\vendor\spatie\laravel-webhook-client\src\WebhookController.php(11): Spatie\WebhookClient\WebhookProcessor->process()
#15 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(48): Spatie\WebhookClient\WebhookController->__invoke(Object(Illuminate\Http\Request), Object(Spatie\WebhookClient\WebhookConfig))
#16 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Route.php(239): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Spatie\WebhookClient\WebhookController), '__invoke')
#17 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Route.php(196): Illuminate\Routing\Route->runController()
#18 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Router.php(685): Illuminate\Routing\Route->run()
#19 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#20 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php(76): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(62): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#28 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(66): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Router.php(687): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#35 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Router.php(662): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#36 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Router.php(628): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#37 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Routing\Router.php(617): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#38 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(165): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#39 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#40 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 C:\inetpub\wwwroot\ableauth\vendor\fruitcake\laravel-cors\src\HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 C:\inetpub\wwwroot\ableauth\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(140): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#54 C:\inetpub\wwwroot\ableauth\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(109): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#55 C:\inetpub\wwwroot\ableauth\public\index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#56 {main}
"}

@ghaskell
Copy link

ghaskell commented May 22, 2020

You're encountering PHP 7.4's typed properties. In my case, I received this error because my job to handle the webhook had a construct method that did not appropriately set the webhookcall property (which must have a type of "Spatie\WebhookClient\Models\WebhookCall").

Here's a proper contruct method:

public WebhookCall $webhookCall;`

public function __construct(WebhookCall $webhookCall)
{
    $this->webhookCall = $webhookCall;
}

Or, you can delete your contruct method to allow it to inherit it from the abstract class.

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

No branches or pull requests

3 participants