Enhanced Search 408 Error

We had the server team upgrade to a more recent version of Elasticsearch. We installed Enhanced Search. When trying to rebuild the index, we get the following error very shortly after hitting the rebuild button.

XFES\Elasticsearch\BulkRequestException: Elasticsearch indexing error: Elasticsearch bulk action error (first error: [ewr_medio_comment-1] closed) src/addons/XFES/Elasticsearch/Api.php:408

Stack trace
#0 src/addons/XFES/Elasticsearch/Api.php(171): XFES\Elasticsearch\Api->bulkRequest('{"index":{"_ind...')
#1 src/addons/XFES/Search/Source/Elasticsearch.php(82): XFES\Elasticsearch\Api->indexBulk(Array)
#2 src/addons/XFES/Search/Source/Elasticsearch.php(57): XFES\Search\Source\Elasticsearch->flushBulkIndexing()
#3 src/XF/Search/Search.php(40): XFES\Search\Source\Elasticsearch->index(Object(XF\Search\IndexRecord))
#4 src/XF/Search/Search.php(59): XF\Search\Search->index('ewr_medio_comme...', Object(EWR\Discord\Entity\MedioComment))
#5 src/XF/Search/Search.php(85): XF\Search\Search->indexEntities('ewr_medio_comme...', Object(XF\Mvc\Entity\ArrayCollection))
#6 src/XF/Job/SearchRebuild.php(57): XF\Search\Search->indexRange('ewr_medio_comme...', 0, '500')
#7 src/XF/Job/Manager.php(241): XF\Job\SearchRebuild->run(7.9999980926514)
#8 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999980926514)
#9 src/XF/Job/Manager.php(103): XF\Job\Manager->runJobEntry(Array, 7.9999980926514)
#10 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#11 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'run-job', 'html', Object(XF\Mvc\ParameterBag), 'tools', Object(XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state
array(4) {
["url"] => string(31) "/forums/admin.php?tools/run-job"
["referrer"] => string(137) "https://domainname/forums/admin.php...ect=/forums/admin.php?tools/rebuild&success=1"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(67) "https://domainname/forums/admin.php?tools/rebuild&success=1"
["_xfToken"] => string(8) "********"
["only_ids"] => string(5) "63772"
}
}
 
There is reference to an add-on in the trace -- ewr_medio_comment -- so that would be the first thing to check.

You can contact the author of the add-on for support.
 
Hi. Thanks for the quick reply. It seems to happen under any setting (threads vs. all), and when we set it to anything other than all it doesn't mention the ewr medio comment at all. The error also happens if all add ons are on or off.

XFES\Elasticsearch\BulkRequestException: Elasticsearch indexing error: Elasticsearch bulk action error (first error: [thread-2763811] closed) src/addons/XFES/Elasticsearch/Api.php:408

Stack trace
#0 src/addons/XFES/Elasticsearch/Api.php(171): XFES\Elasticsearch\Api->bulkRequest('{"index":{"_ind...')
#1 src/addons/XFES/Search/Source/Elasticsearch.php(82): XFES\Elasticsearch\Api->indexBulk(Array)
#2 src/addons/XFES/Search/Source/Elasticsearch.php(57): XFES\Search\Source\Elasticsearch->flushBulkIndexing()
#3 src/XF/Search/Search.php(40): XFES\Search\Source\Elasticsearch->index(Object(XF\Search\IndexRecord))
#4 src/XF/Search/Search.php(59): XF\Search\Search->index('thread', Object(SV\ContentRatings\XF\Entity\Thread))
#5 src/XF/Search/Search.php(85): XF\Search\Search->indexEntities('thread', Object(XF\Mvc\Entity\ArrayCollection))
#6 src/XF/Job/SearchRebuild.php(57): XF\Search\Search->indexRange('thread', 0, '500')
#7 src/XF/Job/Manager.php(241): XF\Job\SearchRebuild->run(7.9999988079071)
#8 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999988079071)
#9 src/XF/Job/Manager.php(103): XF\Job\Manager->runJobEntry(Array, 7.9999988079071)
#10 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#11 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'run-job', 'html', Object(XF\Mvc\ParameterBag), 'tools', Object(XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state
array(4) {
["url"] => string(31) "/forums/admin.php?tools/run-job"
["referrer"] => string(137) "https://domainname/forums/admin.php...ect=/forums/admin.php?tools/rebuild&success=1"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(67) "https://domainname/forums/admin.php?tools/rebuild&success=1"
["_xfToken"] => string(8) "********"
["only_ids"] => string(5) "64651"
}
}

------------------------------------------

XFES\Elasticsearch\BulkRequestException: Elasticsearch indexing error: Elasticsearch bulk action error (first error: [profile_post-1] closed) src/addons/XFES/Elasticsearch/Api.php:408


Stack trace
#0 src/addons/XFES/Elasticsearch/Api.php(171): XFES\Elasticsearch\Api->bulkRequest('{"index":{"_ind...')
#1 src/addons/XFES/Search/Source/Elasticsearch.php(82): XFES\Elasticsearch\Api->indexBulk(Array)
#2 src/addons/XFES/Search/Source/Elasticsearch.php(57): XFES\Search\Source\Elasticsearch->flushBulkIndexing()
#3 src/XF/Search/Search.php(40): XFES\Search\Source\Elasticsearch->index(Object(XF\Search\IndexRecord))
#4 src/XF/Search/Search.php(59): XF\Search\Search->index('profile_post', Object(EWR\Discord\Entity\ProfilePost))
#5 src/XF/Search/Search.php(85): XF\Search\Search->indexEntities('profile_post', Object(XF\Mvc\Entity\ArrayCollection))
#6 src/XF/Job/SearchRebuild.php(57): XF\Search\Search->indexRange('profile_post', 0, '500')
#7 src/XF/Job/Manager.php(241): XF\Job\SearchRebuild->run(7.9999980926514)
#8 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999980926514)
#9 src/XF/Job/Manager.php(103): XF\Job\Manager->runJobEntry(Array, 7.9999980926514)
#10 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#11 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'run-job', 'html', Object(XF\Mvc\ParameterBag), 'tools', Object(XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state
array(4) {
["url"] => string(31) "/forums/admin.php?tools/run-job"
["referrer"] => string(137) "https://domainname/forums/admin.php...ect=/forums/admin.php?tools/rebuild&success=1"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(67) "https://domainname/forums/admin.php?tools/rebuild&success=1"
["_xfToken"] => string(8) "********"
["only_ids"] => string(5) "64651"
}
}
 
Last edited:
The error seems to indicate that the index is closed, which is an API call in Elasticsearch, though it may be indicative of another problem, so you may want to look at the Elasticsearch error log.

If you don't see anything, I'd try restarting Elasticsearch.
 
Sometimes blowing away ElasticSearch and then re-installing it fixes the index getting into a bizarre state. Normally just emptying /var/lib/elasticsearch is enough as this removes all the index state so it can't get confused.
 
Top Bottom