Fixed Elasticsearch server returned no response. Is it running?

Anthony Parsons

Well-known member
I keep seeing this at periodic times in my error log:


Error Info
XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: Unknown Account, Yesterday at 11:57 PM
Stack Trace
#0 /home/ptsdforu/public_html/c/library/XenES/Search/SourceHandler/ElasticSearch.php(200): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(false, true)
#1 /home/ptsdforu/public_html/c/library/XenForo/Search/SourceHandler/Abstract.php(115): XenES_Search_SourceHandler_ElasticSearch->executeSearch('black metal', false, Array, Array, false, '100')
#2 /home/ptsdforu/public_html/c/library/XenForo/Search/Searcher.php(79): XenForo_Search_SourceHandler_Abstract->searchGeneral('black metal', Array, 'date', '100')
#3 /home/ptsdforu/public_html/c/library/XenForo/ControllerPublic/Search.php(230): XenForo_Search_Searcher->searchGeneral('black metal', Array, 'date')
#4 /home/ptsdforu/public_html/c/library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Search->actionSearch()
#5 /home/ptsdforu/public_html/c/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/ptsdforu/public_html/c/index.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
["url"] => string(41) "https://www.ptsdforum.org/c/search/search"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["keywords"] => string(11) "black metal"
["users"] => string(0) ""
["date"] => string(0) ""
["_xfToken"] => string(0) ""
}

 
Bit of a strange problem.

ES worked fine on our dev install (basically a full copy of our live site).

Trying to install it on our live site (the same server) and it stops half way through giving the "is elastic search running" error and it definitely is running....:p
 
I get them too - same line number in the error report:

Code:
XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: Unknown Account, Today at 03:54
 
Bit of a strange problem.

ES worked fine on our dev install (basically a full copy of our live site).

Trying to install it on our live site (the same server) and it stops half way through giving the "is elastic search running" error and it definitely is running....:p


Sounds like you might be hitting the open file limit in this case.

I get them too - same line number in the error report:

Code:
XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: Unknown Account, Today at 03:54

Same as before, only showing up periodically but generally everything works fine?
 
Same as before, only showing up periodically but generally everything works fine?

Yup - only get then once in a while. I've optimised my server some more recently which has smoothed-out some of the higher IO/load numbers I was seeing, so we'll see how it goes as that may have been a contributory factor (IO bottlenecks leading to ES timeouts?).

Just posting to say I'm seeing the exact same thing in my install. (y)

I'm not overly concerned, but as with all such niggles it can be quite cathartic to see the back of them. :D
 
One thing you may want to do is up the timeout for the HTTP Client that communicates with Elastic Search. By default Zend's HTTP Client timeout is 10 seconds. While that should be enough time in 99.99% of the cases, you might hit a time where there is some sort of lock going on. ES will occasionally do index merges/consolidation, so you can't write data at that exact moment in time.

A quick fix to the above issues may just be to up the timeout to 30 seconds instead of 10 seconds.

In the XenES_Api, change this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true));
to this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true, 'timeout' => 30));
 
A quick fix to the above issues may just be to up the timeout to 30 seconds instead of 10 seconds.

In the XenES_Api, change this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true));
to this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true, 'timeout' => 30));
This actually caused me an issue when creating moderators, when doing it for the first time it takes longer than 30 seconds and timed out due to this. When I removed it, getting a moderator created worked again. Adding a mod further takes seconds to do, but making a mod for the first time seems to take longer with writing permissions, and this caused a timeout at 30 seconds as a result.
 
I don't know... but it is the only thing changed with 30 seconds, and suddenly I'm getting an error on another function via Zend that I've never gotten before timing out with 30 seconds. I tried it several times and got the error... the moment I changed it back, no error.
 
I asked because that had a Zend timeout issue in an older version and I wondered if that was the possible cause of the problem?

Might be worth disabling XenSSO briefly and re-trying the ES change to see if you get the same problem?
 
In the XenES_Api, change this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true));
to this:
PHP:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true, 'timeout' => 30));

I made this change a couple of days ago, and *so far* that has gotten rid of the handful (4-6?) of ES errors I was getting per day, with one exception: Tapatalk.

XenForo_Exception: Elasticsearch server returned no response. Is it running? - library/XenES/Search/SourceHandler/ElasticSearch.php:721
Generated By: user, Today at 1:32 PM
Stack Trace
#0 /path/library/XenES/Search/SourceHandler/ElasticSearch.php(200): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(false, true)
#1 /path/library/XenForo/Search/SourceHandler/Abstract.php(152): XenES_Search_SourceHandler_ElasticSearch->executeSearch('', false, Array, Array, 'thread', '500', Object(XenForo_Search_DataHandler_Post))
#2 /path/library/XenForo/Search/Searcher.php(111): XenForo_Search_SourceHandler_Abstract->searchType(Object(XenForo_Search_DataHandler_Post), '', Array, 'date', 1, '500')
#3 /path/mobiquo/include/get_participated_topic.php(65): XenForo_Search_Searcher->searchType(Object(XenForo_Search_DataHandler_Post), '', Array, 'date', 1)
#4 [internal function]: get_participated_topic_func(Object(xmlrpcmsg))
#5 /path/mobiquo/lib/xmlrpcs.inc(1085): call_user_func('get_participate...', Object(xmlrpcmsg))
#6 /path/mobiquo/lib/xmlrpcs.inc(996): xmlrpc_server->execute(Object(xmlrpcmsg))
#7 /path/library/Tapatalk/xmlrpcs.php(36): xmlrpc_server->parseRequest('<?xml version="...', 'US-ASCII')
#8 /path/mobiquo/mobiquo.php(112): Tapatalk_xmlrpcs->service()
#9 {main}
Request State
array(3) {
["url"] => string(46) "http://url/forum/mobiquo/mobiquo.php"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

Interestingly, of the six instances of this error since I increased the zend timeout, *five* of them have been caused by the same user. Any chance a bad mobile connection/high latency issue might be contributing?
 
Doubtful... the timeout issue only affects communication between your web server and the Elastic Search server (maybe the same server)?
 
Sice yesterday, I have the exact same error.
I have not changed the configuration.

Im my api is this line:

Code:
$this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true, 'timeout' => 45));
 
Top Bottom