1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Elasticsearch server returned no response. Is it running?

Discussion in 'Enhanced Search Resolved Bugs' started by Anthony Parsons, Jul 3, 2012.

  1. Anthony Parsons

    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) ""

  2. stephen bosen

    stephen bosen New Member

    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
  3. CyclingTribe

    CyclingTribe Well-Known Member

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

    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
  4. Slavik

    Slavik XenForo Moderator Staff Member

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

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

    CyclingTribe Well-Known Member

    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
  6. digitalpoint

    digitalpoint Well-Known Member

    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:
    $this->_httpClient XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true));
    to this:
    $this->_httpClient XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true'timeout' => 30));
    CyclingTribe and Anthony Parsons like this.
  7. Anthony Parsons

    Anthony Parsons Well-Known Member

    I think that sounds like a good change regardless... nothing wrong with a little more wriggle room IMHO. Thanks.
  8. Anthony Parsons

    Anthony Parsons Well-Known Member

    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.
  9. digitalpoint

    digitalpoint Well-Known Member

    Why does creating a moderator take more than 30 seconds? Also, why is Elastic Search indexing anything when you create a moderator?
  10. CyclingTribe

    CyclingTribe Well-Known Member

    That's what I was wondering?
  11. Anthony Parsons

    Anthony Parsons Well-Known Member

    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.
  12. CyclingTribe

    CyclingTribe Well-Known Member

    Just out of interest, you're not using the XenSSO add-on are you?
  13. Anthony Parsons

    Anthony Parsons Well-Known Member

  14. CyclingTribe

    CyclingTribe Well-Known Member

    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?
    Anthony Parsons likes this.
  15. shawn

    shawn Well-Known Member

    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.

    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?
  16. digitalpoint

    digitalpoint Well-Known Member

    Doubtful... the timeout issue only affects communication between your web server and the Elastic Search server (maybe the same server)?
  17. Mike

    Mike XenForo Developer Staff Member

    I've extended the timeout.
  18. DRaver

    DRaver Active Member

    Sice yesterday, I have the exact same error.
    I have not changed the configuration.

    Im my api is this line:

    $this->_httpClient = XenForo_Helper_Http::getClient($this->_server, array('keepalive' => true, 'timeout' => 45));
  19. Walter

    Walter Well-Known Member

  20. DRaver

    DRaver Active Member

    I don't get it.
    What must I do?

Share This Page