AbuseIO / AbuseIO

AbuseIO is a toolkit to receive, process, correlate and notify about abuse reports received by network operators, typically hosting and access providers.
212 stars 66 forks source link

4.3 - custom email and ash templates broken #364

Open mikenowak opened 3 years ago

mikenowak commented 3 years ago

Testing 4.3 branch here (commit d2b47cd3b42a8617e0554f2a69c9b2a58aaad66d) here and It appears that custom email templates and ash templates, as specified under the brand are no longer working.

Additionally, I was able to establish:

Below is the stack trace

production.ERROR: First parameter must either be an object or the name of an existing class {"exception":"[object] (ErrorException(code: 0): First parameter must either be an object or the name of an existing class at /var/www/html/vendor/wpb/string-blade-compiler/src/Compilers/StringBladeCompiler.php:47)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /var/www/html/vendor/wpb/string-blade-compiler/src/Compilers/StringBladeCompiler.php(47): property_exists()
#2 /var/www/html/app/Providers/ValidationsServiceProvider.php(267): Wpb\\String_Blade_Compiler\\Compilers\\StringBladeCompiler->compile()
#3 [internal function]: AbuseIO\\Providers\\ValidationsServiceProvider->AbuseIO\\Providers\\{closure}()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(1160): call_user_func_array()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(1194): Illuminate\\Validation\\Validator->callExtension()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(398): Illuminate\\Validation\\Validator->__call()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(277): Illuminate\\Validation\\Validator->validateAttribute()
#8 /var/www/html/vendor/abuseio/notification-mail/src/Mail.php(146): Illuminate\\Validation\\Validator->passes()
#9 /var/www/html/app/Jobs/Notification.php(48): AbuseIO\\Notification\\Mail->send()
#10 /var/www/html/app/Jobs/Notification.php(109): AbuseIO\\Jobs\\Notification->send()
#11 /var/www/html/app/Observers/EventObserver.php(37): AbuseIO\\Jobs\\Notification->walkList()
#12 [internal function]: AbuseIO\\Observers\\EventObserver->created()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(366): call_user_func_array()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(188): Illuminate\\Events\\Dispatcher->dispatch()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(825): Illuminate\\Database\\Eloquent\\Model->fireModelEvent()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(667): Illuminate\\Database\\Eloquent\\Model->performInsert()
#18 /var/www/html/app/Jobs/IncidentsSave.php(233): Illuminate\\Database\\Eloquent\\Model->save()
#19 /var/www/html/app/Jobs/IncidentsProcess.php(111): AbuseIO\\Jobs\\IncidentsSave->save()
#20 /var/www/html/app/Jobs/CollectorProcess.php(153): AbuseIO\\Jobs\\IncidentsProcess->save()
#21 [internal function]: AbuseIO\\Jobs\\CollectorProcess->handle()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(522): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): value()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(591): Illuminate\\Container\\BoundMethod::call()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\\Container\\Container->call()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(83): Illuminate\\Bus\\Dispatcher->dispatchNow()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(85): Illuminate\\Pipeline\\Pipeline->then()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(59): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\\Queue\\CallQueuedHandler->call()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(348): Illuminate\\Queue\\Jobs\\Job->fire()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(294): Illuminate\\Queue\\Worker->process()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(129): Illuminate\\Queue\\Worker->runJob()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\\Queue\\Worker->daemon()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#42 [internal function]: Illuminate\\Queue\\Console\\WorkCommand->handle()
#43 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(522): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): value()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(591): Illuminate\\Container\\BoundMethod::call()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(202): Illuminate\\Container\\Container->call()
#49 /var/www/html/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute()
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(189): Symfony\\Component\\Console\\Command\\Command->run()
#51 /var/www/html/vendor/symfony/console/Application.php(1009): Illuminate\\Console\\Command->run()
#52 /var/www/html/vendor/symfony/console/Application.php(273): Symfony\\Component\\Console\\Application->doRunCommand()
#53 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\\Component\\Console\\Application->doRun()
#54 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\\Component\\Console\\Application->run()
#55 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\\Console\\Application->run()
#56 /var/www/html/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#57 {main}
"}
mikenowak commented 3 years ago

@kruisdraad, this persists - just upgraded to latest release and confirm the problem didn't go away can you check if you are getting the same?

Edit:

I was able to track it to empty string at

https://github.com/AbuseIO/AbuseIO/blob/2205b6a44912286a7e9318f37dc537d923d792bb/app/Providers/ValidationsServiceProvider.php#L264

Now I am not sure what the intention here was, but it appears this was some hack for Laravel 5 that no longer works on Laravel 6 if I understand this correctly - https://github.com/TerrePorter/StringBladeCompiler#new-config-option