FriendsOfFlarum / webhooks

Flarum with outgoing webhooks
MIT License
21 stars 12 forks source link

Beta 16 Compatibility: Exception: Serialization of 'Closure' is not allowed in illuminate/queue/Queue.php:157 #34

Closed ctml91 closed 3 years ago

ctml91 commented 3 years ago

Bug Report

Current Behavior

[2021-04-21 23:42:47] flarum.ERROR: Exception: Serialization of 'Closure' is not allowed in /usr/share/nginx/flarum/vendor/illuminate/queue/Queue.php:157
Stack trace:
#0 /usr/share/nginx/flarum/vendor/illuminate/queue/Queue.php(157): serialize(Object(FoF\Webhooks\Jobs\HandleEvent))
#1 /usr/share/nginx/flarum/vendor/illuminate/queue/Queue.php(127): Illuminate\Queue\Queue->createObjectPayload(Object(FoF\Webhooks\Jobs\HandleEvent), NULL)
#2 /usr/share/nginx/flarum/vendor/illuminate/queue/Queue.php(105): Illuminate\Queue\Queue->createPayloadArray(Object(FoF\Webhooks\Jobs\HandleEvent), NULL, '')
#3 /usr/share/nginx/flarum/vendor/illuminate/queue/SyncQueue.php(38): Illuminate\Queue\Queue->createPayload(Object(FoF\Webhooks\Jobs\HandleEvent), NULL, '')
#4 /usr/share/nginx/flarum/vendor/fof/webhooks/src/Listener/TriggerListener.php(86): Illuminate\Queue\SyncQueue->push(Object(FoF\Webhooks\Jobs\HandleEvent))
#5 /usr/share/nginx/flarum/vendor/illuminate/events/Dispatcher.php(389): FoF\Webhooks\Listener\TriggerListener->run('Flarum\\Post\\Eve...', Array)
#6 /usr/share/nginx/flarum/vendor/illuminate/events/Dispatcher.php(237): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Flarum\\Post\\Eve...', Array)
#7 /usr/share/nginx/flarum/vendor/flarum/core/src/Foundation/DispatchEventsTrait.php(33): Illuminate\Events\Dispatcher->dispatch('Flarum\\Post\\Eve...')
#8 /usr/share/nginx/flarum/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(104): Flarum\Post\Command\PostReplyHandler->dispatchEventsFor(Object(Flarum\Post\CommentPost), Object(Flarum\User\User))
#9 /usr/share/nginx/flarum/vendor/flarum/core/src/Notification/NotificationSyncer.php(148): Flarum\Post\Command\PostReplyHandler->Flarum\Post\Command\{closure}()
#10 /usr/share/nginx/flarum/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(105): Flarum\Notification\NotificationSyncer->onePerUser(Object(Closure))
#11 /usr/share/nginx/flarum/vendor/illuminate/bus/Dispatcher.php(122): Flarum\Post\Command\PostReplyHandler->handle(Object(Flarum\Post\Command\PostReply))
#12 /usr/share/nginx/flarum/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Flarum\Post\Command\PostReply))
#13 /usr/share/nginx/flarum/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\Post\Command\PostReply))
#14 /usr/share/nginx/flarum/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 /usr/share/nginx/flarum/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\Post\Command\PostReply))
#16 /usr/share/nginx/flarum/vendor/flarum/core/src/Api/Controller/CreatePostController.php(61): Illuminate\Bus\Dispatcher->dispatch(Object(Flarum\Post\Command\PostReply))
#17 /usr/share/nginx/flarum/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(102): Flarum\Api\Controller\CreatePostController->data(Object(Laminas\Diactoros\ServerRequest), Object(Tobscure\JsonApi\Document))
#18 /usr/share/nginx/flarum/vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\Api\Controller\AbstractSerializeController->handle(Object(Laminas\Diactoros\ServerRequest))
#19 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\Api\Controller\AbstractCreateController->handle(Object(Laminas\Diactoros\ServerRequest))
#20 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerRequest), Array)
#21 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ExecuteRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closure))
#22 /usr/share/nginx/flarum/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#23 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Api\Middleware\ThrottleApi->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#24 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#25 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#26 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#27 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ResolveRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#28 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#29 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#30 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#31 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#32 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#33 /usr/share/nginx/flarum/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#34 /usr/share/nginx/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
:

Steps to Reproduce

  1. Create a slack webhook
  2. Perform event that triggers webhook

Environment

Flarum core 0.1.0-beta.16
PHP version: 7.4.6
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, sqlsrv, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, intl, json, ldap, exif, mysqlnd, PDO, Phar, posix, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlwriter, xsl, mysqli, pdo_mysql, pdo_sqlite, xmlreader, zip, Zend OPcache
+------------------------------------+------------------+--------+
| Flarum Extensions                  |                  |        |
+------------------------------------+------------------+--------+
| ID                                 | Version          | Commit |
+------------------------------------+------------------+--------+
| flarum-subscriptions               | v0.1.0-beta.16   |        |
| flarum-tags                        | v0.1.0-beta.16   |        |
| flarum-markdown                    | v0.1.0-beta.16.1 |        |
| flarum-flags                       | v0.1.0-beta.16   |        |
| fof-follow-tags                    | 0.7.2            |        |
| flarum-lock                        | v0.1.0-beta.16   |        |
| askvortsov-rich-text               | v1.1.1           |        |
| nearata-internal-links-noreload    | v1.0.2           |        |
| fof-webhooks                       | 0.5.1            |        |
| flarum-approval                    | v0.1.0-beta.16   |        |
| flarum-bbcode                      | v0.1.0-beta.16   |        |
| flarum-emoji                       | v0.1.0-beta.16   |        |
| flarum-lang-english                | v0.1.0-beta.16   |        |
| flarum-mentions                    | v0.1.0-beta.16   |        |
| flarum-statistics                  | v0.1.0-beta.16   |        |
| flarum-sticky                      | v0.1.0-beta.16   |        |
| flarum-suspend                     | v0.1.0-beta.16   |        |
| fof-user-directory                 | 0.6.1            |        |
| fof-split                          | 0.7.0            |        |
| fof-github-autolink                | 0.1.6            |        |
| fof-formatting                     | 0.4.0            |        |
| fof-best-answer                    | 0.4.0            |        |
| fof-realtimedate                   | 0.3.0            |        |
| fof-polls                          | 0.4.1            |        |
| fof-upload                         | 0.14.0           |        |
| fof-links                          | 0.6.0            |        |
| fof-moderator-notes                | 0.5.0            |        |
| fof-subscribed                     | 0.5.0            |        |
| fof-analytics                      | 0.12.0           |        |
| fof-profile-image-crop             | 0.3.0            |        |
| fof-masquerade                     | 0.4.0            |        |
| fof-user-bio                       | 0.5.0            |        |
| fof-default-user-preferences       | 0.4.0            |        |
| fof-socialprofile                  | 0.3.0            |        |
| flarum-likes                       | v0.1.0-beta.16   |        |
| askvortsov-discussion-templates    | v0.7.0           |        |
| clarkwinkelmann-who-read           | 1.3.0            |        |
| clarkwinkelmann-author-change      | 0.2.3            |        |
| askvortsov-moderator-warnings      | v0.5.0           |        |
| flarum-nicknames                   | 0.1.0-beta.16.1  |        |
| fof-bbcode-details                 | 0.3.0            |        |
| therealsujitk-gifs                 | v3.0.0           |        |
| clarkwinkelmann-follow-tags-prompt | 0.2.1            |        |
| fof-pretty-mail                    | 0.4.0            |        |
| v17development-blog                | v0.3.0           |        |
| askvortsov-trust-levels            | v1.0.0           |        |
| nearata-embed-video                | v2.1.1           |        |
| ianm-follow-users                  | 0.2.2            |        |
| v17development-user-badges         | v0.1.2           |        |
| askvortsov-checklist               | v1.1.0           |        |
| ffans-clipboardjs                  | v0.1.0-beta.16.1 |        |
| flarumtr-post-bookmarks            | v0.1.0           |        |
+------------------------------------+------------------+--------+
therealgorgan commented 3 years ago

Also getting this error but with Discord and it gives an error anytime someone posts or tries to sign up. Same error in the logs. This causes the red popup when people try to post an article or create an account that says "Oops there was an error. Try reloading this page and try again."

NGINX Flarum 0.1.0-beta.16 PHP 7.4.3 MySQL 10.3.29-MariaDB-0ubuntu0.20.04.1

Stack trace:
#0 /var/www/forums.legendsofultima.online/vendor/illuminate/queue/Queue.php(158): serialize()
#1 /var/www/forums.legendsofultima.online/vendor/illuminate/queue/Queue.php(127): Illuminate\Queue\Queue->createObjectPayload()
#2 /var/www/forums.legendsofultima.online/vendor/illuminate/queue/Queue.php(105): Illuminate\Queue\Queue->createPayloadArray()
#3 /var/www/forums.legendsofultima.online/vendor/illuminate/queue/SyncQueue.php(38): Illuminate\Queue\Queue->createPayload()
#4 /var/www/forums.legendsofultima.online/vendor/fof/webhooks/src/Listener/TriggerListener.php(86): Illuminate\Queue\SyncQueue->push()
#5 /var/www/forums.legendsofultima.online/vendor/illuminate/events/Dispatcher.php(389): FoF\Webhooks\Listener\TriggerListener->run()
#6 /var/www/forums.legendsofultima.online/vendor/illuminate/events/Dispatcher.php(237): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
#7 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Foundation/DispatchEventsTrait.php(33): Illuminate\Events\Dispatcher->dispatch()
#8 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Discussion/Command/StartDiscussionHandler.php(97): Flarum\Discussion\Command\StartDiscussionHandler->dispatchEventsFor()
#9 /var/www/forums.legendsofultima.online/vendor/illuminate/bus/Dispatcher.php(122): Flarum\Discussion\Command\StartDiscussionHandler->handle()
#10 /var/www/forums.legendsofultima.online/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#11 /var/www/forums.legendsofultima.online/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#12 /var/www/forums.legendsofultima.online/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#13 /var/www/forums.legendsofultima.online/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow()
#14 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Api/Controller/CreateDiscussionController.php(60): Illuminate\Bus\Dispatcher->dispatch()
#15 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(102): Flarum\Api\Controller\CreateDiscussionController->data()
#16 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\Api\Controller\AbstractSerializeController->handle()
#17 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\Api\Controller\AbstractCreateController->handle()
#18 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
#19 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ExecuteRoute->process()
#20 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
#21 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Api\Middleware\ThrottleApi->process()
#22 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
#23 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\CheckCsrfToken->process()
#24 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
#25 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ResolveRoute->process()
#26 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\Stratigility\Next->handle()
#27 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\SetLocale->process()
#28 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Laminas\Stratigility\Next->handle()
#29 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#30 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\Stratigility\Next->handle()
#31 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\AuthenticateWithSession->process()
#32 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#33 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\RememberFromCookie->process()
#34 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#35 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\StartSession->process()
#36 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#37 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Api\Middleware\FakeHttpMethods->process()
#38 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#39 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ParseJsonBody->process()
#40 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#41 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\HandleErrors->process()
#42 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle()
#43 /var/www/forums.legendsofultima.online/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#44 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\RequestHandler->process()
#45 /var/www/forums.legendsofultima.online/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#46 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePathRouter->process()
#47 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\Stratigility\Next->handle()
#48 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Middleware\OriginalMessages->process()
#49 /var/www/forums.legendsofultima.online/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#50 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\BasePath->process()
#51 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#52 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\Http\Middleware\ProcessIp->process()
#53 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle()
#54 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe->process()
#55 /var/www/forums.legendsofultima.online/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#56 /var/www/forums.legendsofultima.online/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#57 /var/www/forums.legendsofultima.online/public/index.php(26): Flarum\Http\Server->listen()
#58 {main}  
dsevillamartin commented 3 years ago

Not fixed, replaced with #37.