问题表现:
刚开Debug记录log如下:
{
"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 /data/wwwroot/community.wvbtech.com/vendor/alongwy/flarum-elasticsearch/src/Utils/SearchUtils.php:99\nStack trace:\n#0 /data/wwwroot/community.wvbtech.com/vendor/alongwy/flarum-elasticsearch/src/Service/SearchService.php(151): Plugin\\ESearch\\Utils\\SearchUtils->getESearch()\n#1 /data/wwwroot/community.wvbtech.com/vendor/alongwy/flarum-elasticsearch/src/SearchDispatcher.php(59): Plugin\\ESearch\\Service\\SearchService->addPostToIndex()\n#2 /data/wwwroot/community.wvbtech.com/vendor/illuminate/events/Dispatcher.php(360): Plugin\\ESearch\\SearchDispatcher->posted()\n#3 /data/wwwroot/community.wvbtech.com/vendor/illuminate/events/Dispatcher.php(209): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()\n#4 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Foundation/DispatchEventsTrait.php(33): Illuminate\\Events\\Dispatcher->dispatch()\n#5 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(106): Flarum\\Post\\Command\\PostReplyHandler->dispatchEventsFor()\n#6 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Notification/NotificationSyncer.php(148): Flarum\\Post\\Command\\PostReplyHandler->Flarum\\Post\\Command\\{closure}()\n#7 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Post/Command/PostReplyHandler.php(107): Flarum\\Notification\\NotificationSyncer->onePerUser()\n#8 /data/wwwroot/community.wvbtech.com/vendor/illuminate/bus/Dispatcher.php(90): Flarum\\Post\\Command\\PostReplyHandler->handle()\n#9 /data/wwwroot/community.wvbtech.com/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()\n#10 /data/wwwroot/community.wvbtech.com/vendor/illuminate/pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()\n#11 /data/wwwroot/community.wvbtech.com/vendor/illuminate/bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then()\n#12 /data/wwwroot/community.wvbtech.com/vendor/illuminate/bus/Dispatcher.php(76): Illuminate\\Bus\\Dispatcher->dispatchNow()\n#13 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Api/Controller/CreatePostController.php(73): Illuminate\\Bus\\Dispatcher->dispatch()\n#14 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(96): Flarum\\Api\\Controller\\CreatePostController->data()\n#15 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Api/Controller/AbstractCreateController.php(22): Flarum\\Api\\Controller\\AbstractSerializeController->handle()\n#16 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\\Api\\Controller\\AbstractCreateController->handle()\n#17 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\\Http\\RouteHandlerFactory->Flarum\\Http\\{closure}()\n#18 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\DispatchRoute->process()\n#19 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Laminas\\Stratigility\\Next->handle()\n#20 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\SetLocale->process()\n#21 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(45): Laminas\\Stratigility\\Next->handle()\n#22 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\CheckCsrfToken->process()\n#23 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Laminas\\Stratigility\\Next->handle()\n#24 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithHeader->process()\n#25 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\\Stratigility\\Next->handle()\n#26 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\AuthenticateWithSession->process()\n#27 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Laminas\\Stratigility\\Next->handle()\n#28 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\RememberFromCookie->process()\n#29 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\\Stratigility\\Next->handle()\n#30 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\StartSession->process()\n#31 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\\Stratigility\\Next->handle()\n#32 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Api\\Middleware\\FakeHttpMethods->process()\n#33 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\\Stratigility\\Next->handle()\n#34 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\ParseJsonBody->process()\n#35 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\\Stratigility\\Next->handle()\n#36 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Flarum\\Http\\Middleware\\HandleErrors->process()\n#37 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle()\n#38 /data/wwwroot/community.wvbtech.com/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\\Stratigility\\MiddlewarePipe->process()\n#39 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\RequestHandler->process()\n#40 /data/wwwroot/community.wvbtech.com/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Laminas\\Stratigility\\Next->handle()\n#41 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePathRouter->process()\n#42 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\\Stratigility\\Next->handle()\n#43 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\\Stratigility\\Middleware\\OriginalMessages->process()\n#44 /data/wwwroot/community.wvbtech.com/vendor/middlewares/base-path/src/BasePath.php(53): Laminas\\Stratigility\\Next->handle()\n#45 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/Next.php(61): Middlewares\\BasePath->process()\n#46 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\\Stratigility\\Next->handle()\n#47 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\\Stratigility\\MiddlewarePipe->process()\n#48 /data/wwwroot/community.wvbtech.com/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\\Stratigility\\MiddlewarePipe->handle()\n#49 /data/wwwroot/community.wvbtech.com/vendor/flarum/core/src/Http/Server.php(42): Laminas\\HttpHandlerRunner\\RequestHandlerRunner->run()\n#50 /data/wwwroot/community.wvbtech.com/public/index.php(39): Flarum\\Http\\Server->listen()\n#51 {main}"
}
]
}
操作过程:
在回复或编辑帖子的时候均会出现,且不让composer关闭。这会导致重复发帖。