Closed ThatKoffe closed 3 years ago
A temp solution to this is to disable the plugin...
I think the webhooks have error handling - what is the error you see in the forum log (storage/logs/flarum-<date>.log
)?
Is this only on discord or would slack be affected too. I'm still on beta 15 but I wouldn't want to upgrade without webhooks ;)
There should be an error message right before the #0
I think, starting with the date & time the error occurred.
There should be an error message right before the
#0
I think, starting with the date & time the error occurred.
Sorry, i may have not seen this: [2021-06-07 07:21:43] flarum.ERROR: Exception: Serialization of 'Closure' is not allowed in /var/www/html/flarum/vendor/illuminate/queue/Queue.php:158 Stack trace:
Is this only on discord or would slack be affected too. I'm still on beta 15 but I wouldn't want to upgrade without webhooks ;)
Don't know.
There should be an error message right before the
#0
I think, starting with the date & time the error occurred.Sorry, i may have not seen this: [2021-06-07 07:21:43] flarum.ERROR: Exception: Serialization of 'Closure' is not allowed in /var/www/html/flarum/vendor/illuminate/queue/Queue.php:158 Stack trace:
Looks similar to my issue for Beta 16, but I believe it was fixed in 1.0 update. https://github.com/FriendsOfFlarum/webhooks/issues/34
It was not fixed in the 1.0 update of this extension. This remains a bug.
Do we know what conditions trigger this, so we can try to avoid the bug until a fix can be figured out?
I have the same error with a Slack Webhook when trying to create a new discussion but with Redis configured, here is async request exported as curl:
curl 'https://localhost/api/discussions' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0' \
-H 'Accept: */*' \
-H 'Accept-Language: fr,en-US;q=0.7,en;q=0.3' \
--compressed \
-H 'Referer: https://localhost/t/garbage' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'X-CSRF-Token: REDACTED' \
-H 'Origin: https://localhost \
-H 'DNT: 1' -H 'Connection: keep-alive' \
-H 'Cookie: flarum_remember=REDACTED; flarum_session=REDACTED' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
--data-raw '{"data":{"type":"discussions","attributes":{"title":"Another webhook test","content":"Test"},"relationships":{"tags":{"data":[{"type":"tags","id":"1"},{"type":"tags","id":"68"}]}}}}'
[2021-08-03 13:35:26] flarum.ERROR: Exception: Serialization of 'Closure' is not allowed in /vendor/illuminate/queue/Queue.php:158
Stack trace:
#0 /vendor/illuminate/queue/Queue.php(158): serialize(Object(FoF\Webhooks\Jobs\HandleEvent))
#1 /vendor/illuminate/queue/Queue.php(127): Illuminate\Queue\Queue->createObjectPayload(Object(FoF\Webhooks\Jobs\HandleEvent), 'queues:default')
#2 /vendor/illuminate/queue/RedisQueue.php(196): Illuminate\Queue\Queue->createPayloadArray(Object(FoF\Webhooks\Jobs\HandleEvent), 'queues:default', '')
#3 /vendor/illuminate/queue/Queue.php(105): Illuminate\Queue\RedisQueue->createPayloadArray(Object(FoF\Webhooks\Jobs\HandleEvent), 'queues:default', '')
#4 /vendor/illuminate/queue/RedisQueue.php(120): Illuminate\Queue\Queue->createPayload(Object(FoF\Webhooks\Jobs\HandleEvent), 'queues:default', '')
#5 /vendor/fof/webhooks/src/Listener/TriggerListener.php(90): Illuminate\Queue\RedisQueue->push(Object(FoF\Webhooks\Jobs\HandleEvent))
#6 /vendor/illuminate/events/Dispatcher.php(389): FoF\Webhooks\Listener\TriggerListener->run('Flarum\\Discussi...', Array)
#7 /vendor/illuminate/events/Dispatcher.php(237): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Flarum\\Discussi...', Array)
#8 /vendor/flarum/core/src/Foundation/DispatchEventsTrait.php(33): Illuminate\Events\Dispatcher->dispatch('Flarum\\Discussi...')
#9 /vendor/flarum/core/src/Discussion/Command/StartDiscussionHandler.php(97): Flarum\Discussion\Command\StartDiscussionHandler->dispatchEventsFor(Object(Flarum\Discussion\Discussion), Object(Flarum\User\User))
#10 /vendor/illuminate/bus/Dispatcher.php(122): Flarum\Discussion\Command\StartDiscussionHandler->handle(Object(Flarum\Discussion\Command\StartDiscussion))
#11 /vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Flarum\Discussion\Command\StartDiscussion))
#12 /vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Flarum\Discussion\Command\StartDiscussion))
#13 /vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\Discussion\Command\StartDiscussion))
#15 /vendor/flarum/core/src/Api/Controller/CreateDiscussionController.php(61): Illuminate\Bus\Dispatcher->dispatch(Object(Flarum\Discussion\Command\StartDiscussion))
#16 /vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(110): Flarum\Api\Controller\CreateDiscussionController->data(Object(Laminas\Diactoros\ServerRequest), Object(Tobscure\JsonApi\Document))
#17 /vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\Api\Controller\AbstractSerializeController->handle(Object(Laminas\Diactoros\ServerRequest))
#18 /vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractCreateController->handle(Object(Laminas\Diactoros\ServerRequest))
#19 /vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Laminas\Diactoros\ServerRequest), Array)
#20 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Closure))
#21 /vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#22 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#23 /vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#24 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#25 /vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#26 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#27 /vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#28 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#29 /vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(56): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#30 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#31 /vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#32 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#33 /vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#34 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#35 /vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#36 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#37 /vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#38 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#39 /vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#40 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#41 /vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#42 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#43 /vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#44 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#45 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#46 /vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#47 /vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#48 /vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#49 /vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#50 /vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#51 /vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#52 /vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#53 /vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#54 /vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#55 /vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))
#56 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
#57 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\EmptyPipelineHandler))
#58 /vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRequest))
#59 /vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#60 /public/index.php(26): Flarum\Http\Server->listen()
#61 {main}
Here is my setup info:
Flarum core 1.0.4
PHP version: 7.4.21
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, intl, json, ldap, mbstring, standard, mysqlnd, odbc, pcntl, mysqli, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, Reflection, imap, shmop, SimpleXML, soap, sockets, sodium, exif, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, amqp, imagick, mcrypt, memcache, memcached, mongodb, redis, solr, ssh2, Zend OPcache
+-----------------------+---------+--------+
| Flarum Extensions | | |
+-----------------------+---------+--------+
| ID | Version | Commit |
+-----------------------+---------+--------+
| flarum-tags | v1.0.3 | |
| flarum-subscriptions | v1.0.0 | |
| flarum-suspend | v1.0.0 | |
| fof-webhooks | 1.0.3 | |
| blomstra-cache-assets | 0.5 | |
| fof-follow-tags | 1.0.1 | |
| fof-best-answer | 1.0.1 | |
| fof-links | 1.0.0 | |
| fof-oauth | 1.0.1 | |
| fof-reactions | 1.0.0 | |
| fof-user-directory | 1.0.2 | |
| flarum-emoji | v1.0.0 | |
| flarum-lang-english | v1.0.0 | |
| flarum-lock | v1.0.0 | |
| flarum-markdown | v1.0.1 | |
| flarum-mentions | v1.0.0 | |
| flarum-statistics | v1.0.0 | |
| flarum-sticky | v1.0.0 | |
| fof-pages | 1.0.1 | |
| fof-merge-discussions | 1.0.0 | |
| fof-gamification | 1.0.0 | |
| fof-drafts | 1.0.1 | |
+-----------------------+---------+--------+
Base URL: https://localhost
Installation path: /home/bas/app_418a083e-dabe-45fc-bceb-0caeb3809e79
Debug mode: ON
Fixed in v1.0.4
.
Bug Report
Current Behavior When creating a discussion it will say: An Error occured, please refresh the page, and it doesn't post the webhook (Discord webhook)
Steps to Reproduce
Expected Behavior Discussion should be posted and no error should occur, plus a webhook should be posted
Screenshots If applicable, add screenshots to help explain your problem.
Environment
https://seer.has-no-bra.in/eVff0E https://seer.has-no-bra.in/b39FRA
Possible solution(s) A try catch, or see if the webhook got posted