akaunting / laravel-firewall

Web Application Firewall (WAF) package for Laravel
https://akaunting.com
MIT License
942 stars 106 forks source link

Serialization of 'class@anonymous' is not allowed #34

Closed ben-demotic closed 3 years ago

ben-demotic commented 3 years ago

Firewall 1.2.13 PHP 7.4.3 Laravel 8.33.1 Ubuntu 20.04.2 LTS on WSL 2 (Windows)

Serialization of 'class@anonymous' is not allowed

Whenever the firewall tries to send an email notification, the above message is logged and the email is not sent.

I think the exception is being thrown here:

#11 /path/vendor/akaunting/laravel-firewall/src/Listeners/NotifyUsers.php(26): class@anonymous->notify()

The $notifiable is an anonymous class?

Here is the full stack trace:

[2021-04-08 10:56:45] local.ERROR: Serialization of 'class@anonymous' is not allowed {"exception":"[object] (Exception(code: 0): Serialization of 'class@anonymous' is not allowed at /path/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:157)
[stacktrace]
#0 /path/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(157): serialize()
#1 /path/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(127): Illuminate\\Queue\\Queue->createObjectPayload()
#2 /path/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(105): Illuminate\\Queue\\Queue->createPayloadArray()
#3 /path/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(91): Illuminate\\Queue\\Queue->createPayload()
#4 /path/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(251): Illuminate\\Queue\\DatabaseQueue->push()
#5 /path/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(227): Illuminate\\Bus\\Dispatcher->pushCommandToQueue()
#6 /path/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(77): Illuminate\\Bus\\Dispatcher->dispatchToQueue()
#7 /path/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php(212): Illuminate\\Bus\\Dispatcher->dispatch()
#8 /path/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php(76): Illuminate\\Notifications\\NotificationSender->queueNotification()
#9 /path/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php(39): Illuminate\\Notifications\\NotificationSender->send()
#10 /path/vendor/laravel/framework/src/Illuminate/Notifications/RoutesNotifications.php(18): Illuminate\\Notifications\\ChannelManager->send()
#11 /path/vendor/akaunting/laravel-firewall/src/Listeners/NotifyUsers.php(26): class@anonymous->notify()
#12 /path/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(412): Akaunting\\Firewall\\Listeners\\NotifyUsers->handle()
#13 /path/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(237): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#14 /path/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(432): Illuminate\\Events\\Dispatcher->dispatch()
#15 /path/vendor/akaunting/laravel-firewall/src/Listeners/CheckLogin.php(29): event()
#16 /path/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(412): Akaunting\\Firewall\\Listeners\\CheckLogin->handle()
#17 /path/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(237): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#18 /path/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php(727): Illuminate\\Events\\Dispatcher->dispatch()
#19 /path/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php(372): Illuminate\\Auth\\SessionGuard->fireFailedEvent()
#20 /path/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(307): Illuminate\\Auth\\SessionGuard->attempt()
#21 /path/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Auth\\AuthManager->__call()
#22 /path/app/Http/Requests/Auth/LoginRequest.php(48): Illuminate\\Support\\Facades\\Facade::__callStatic()
#23 /path/app/Http/Controllers/Auth/AuthenticatedSessionController.php(31): App\\Http\\Requests\\Auth\\LoginRequest->authenticate()
#24 /path/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\Auth\\AuthenticatedSessionController->store()
#25 /path/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#26 /path/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#27 /path/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#28 /path/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()
#29 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#30 /path/app/Http/Middleware/RedirectIfAuthenticated.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#31 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\RedirectIfAuthenticated->handle()
#32 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#33 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#34 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#36 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#38 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#40 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#42 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#44 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#46 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#48 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#50 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#52 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#54 /path/vendor/akaunting/laravel-firewall/src/Abstracts/Middleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Akaunting\\Firewall\\Abstracts\\Middleware->handle()
#56 /path/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#58 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#59 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#60 /path/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#62 /path/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#63 /path/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#64 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#65 /path/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#67 /path/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#69 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#70 /path/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then()
#71 /path/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack()
#72 /path/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#73 /path/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#74 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch()
#75 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#76 /path/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#77 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#78 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#79 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#80 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#81 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#82 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#83 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#84 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#85 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#86 /path/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#87 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle()
#88 /path/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#89 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#90 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#91 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#92 /path/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#93 /path/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#94 {main}
"}