问题描述:
无法发帖
报错内容:
正常模式无报错
调试模式报错内容:
POST https://include.ink/api/discussions
{
"errors": [
{
"status": "500",
"code": "unknown",
"detail": "TypeError: Return value of Plugin\\ESearch\\Utils\\SearchUtils::getESearch() must be an instance of Elasticsearch\\Client, null returned in /www/wwwroot/include/vendor/alongwy/flarum-elasticsearch/src/Utils/SearchUtils.php:99\nStack trace:\n#0 /www/wwwroot/include/vendor/alongwy/flarum-elasticsearch/src/Service/SearchService.php(151): Plugin\\ESearch\\Utils\\SearchUtils->getESearch()\n#1 /www/wwwroot/include/vendor/alongwy/flarum-elasticsearch/src/SearchDispatcher.php(59): Plugin\\ESearch\\Service\\SearchService->addPostToIndex(Object(Flarum\\Post\\CommentPost))\n#2 /www/wwwroot/include/vendor/illuminate/events/Dispatcher.php(360): Plugin\\ESearch\\SearchDispatcher->posted(Object(Flarum\\Post\\Event\\Posted))\n#3 /www/wwwroot/include/vendor/illuminate/events/Dispatcher.php(209): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('Flarum\\\\Post\\\\Eve...', Array)\n#4 /www/wwwroot/include/vendor/flarum/core/src/Foundation/DispatchEventsTrait.php(33): Illuminate\\Events\\Dispatcher->dispatch('Flarum\\\\Post\\\\Eve...')\n#5 /www/wwwroot/include/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(106): Flarum\\Post\\Command\\PostReplyHandler->dispatchEventsFor(Object(Flarum\\Post\\CommentPost), Object(Flarum\\User\\User))\n#6 /www/wwwroot/include/vendor/flarum/core/src/Notification/NotificationSyncer.php(148): Flarum\\Post\\Command\\PostReplyHandler->Flarum\\Post\\Command\\{closure}()\n#7 /www/wwwroot/include/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(107): Flarum\\Notification\\NotificationSyncer->onePerUser(Object(Closure))\n#8 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(90): Flarum\\Post\\Command\\PostReplyHandler->handle(Object(Flarum\\Post\\Command\\PostReply))\n#9 /www/wwwroot/include/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Flarum\\Post\\Command\\PostReply))\n#10 /www/wwwroot/include/vendor/illuminate/pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Flarum\\Post\\Command\\PostReply))\n#11 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#12 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(76): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Flarum\\Post\\Command\\PostReply))\n#13 /www/wwwroot/include/vendor/flarum/core/src/Discussion/Command/StartDiscussionHandler.php(84): Illuminate\\Bus\\Dispatcher->dispatch(Object(Flarum\\Post\\Command\\PostReply))\n#14 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(90): Flarum\\Discussion\\Command\\StartDiscussionHandler->handle(Object(Flarum\\Discussion\\Command\\StartDiscussion))\n#15 /www/wwwroot/include/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Flarum\\Discussion\\Command\\StartDiscussion))\n#16 /www/wwwroot/include/vendor/illuminate/pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Flarum\\Discussion\\Command\\StartDiscussion))\n#17 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#18 /www/wwwroot/include/vendor/illuminate/bus/Dispatcher.php(76): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Flarum\\Discussion\\Command\\StartDiscussion))\n#19 /www/wwwroot/include/vendor/flarum/core/src/Api/Controller/CreateDiscussionController.php(72): Illuminate\\Bus\\Dispatcher->dispatch(Object(Flarum\\Discussion\\Command\\StartDiscussion))\n#20 /www/wwwroot/include/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(96): Flarum\\Api\\Controller\\CreateDiscussionController->data(Object(Laminas\\Diactoros\\ServerRequest), Object(Tobscure\\JsonApi\\Document))\n#21 /www/wwwroot/include/vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\\Api\\Controller\\AbstractSerializeController->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#22 /www/wwwroot/include/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\\Api\\Controller\\AbstractCreateController->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#23 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\\Http\\RouteHandlerFactory->Flarum\\Http\\{closure}(Object(Laminas\\Diactoros\\ServerRequest), Array)\n#24 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\DispatchRoute->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Closure))\n#25 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#26 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\SetLocale->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#27 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(45): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#28 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\CheckCsrfToken->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#29 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#30 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithHeader->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#31 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#32 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithSession->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#33 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#34 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\RememberFromCookie->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#35 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#36 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\StartSession->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#37 /www/wwwroot/include/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#38 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Api\\Middleware\\FakeHttpMethods->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#39 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#40 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\ParseJsonBody->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#41 /www/wwwroot/include/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#42 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\HandleErrors->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#43 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#44 /www/wwwroot/include/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\\Stratigility\\MiddlewarePipe->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#45 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\RequestHandler->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#46 /www/wwwroot/include/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#47 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePathRouter->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#48 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#49 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\\Stratigility\\Middleware\\OriginalMessages->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#50 /www/wwwroot/include/vendor/middlewares/base-path/src/BasePath.php(53): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#51 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePath->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\Next))\n#52 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#53 /www/wwwroot/include/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\\Stratigility\\MiddlewarePipe->process(Object(Laminas\\Diactoros\\ServerRequest), Object(Laminas\\Stratigility\\EmptyPipelineHandler))\n#54 /www/wwwroot/include/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\\Stratigility\\MiddlewarePipe->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#55 /www/wwwroot/include/vendor/flarum/core/src/Http/Server.php(42): Laminas\\HttpHandlerRunner\\RequestHandlerRunner->run()\n#56 /www/wwwroot/include/public/index.php(26): Flarum\\Http\\Server->listen()\n#57 {main}"
}
]
}
已尝试的解决办法:
重装数据库搬数据、重装Flaurm并搬数据