Patrick
Patrick

Reputation: 4905

sphinxsearch returns "failed to send client protocol version"

On some of my servers, doing a sphinx php query returns that error. Searching google I can't find anything except this is part of why the error came out:

// send my version
    // this is a subtle part. we must do it before (!) reading back from searchd.
    // because otherwise under some conditions (reported on FreeBSD for instance)
    // TCP stack could throttle write-write-read pattern because of Nagle.
    if (!$this->Send($fp, pack('N', 1), 4))
    {
      fclose($fp);
      $this->error = 'failed to send client protocol version';
      return false;
    }

The close I've found is this http://www.sphinxsearch.com/forum/view.html?id=4919

But I do not know where the sphinxapi.php is (I installed using manual compile) and not sure if that's a good idea.

Anyone has any idea?

Upvotes: 5

Views: 3753

Answers (4)

I have the same problem with Sphinx 2.2.8

What I found is in this version the set of listen port in searchd configuration was removed and now the ports are

listening on all interfaces, port=9312
listening on all interfaces, port=9306

So when you configure the sphinx client use port 9312 works for me. Ie:

$sphinxClient = new SphinxClient()
$sphinxClient->SetServer("localhost", 9312);

Hope this helps you. And if you need more details about the basic configuration just ask me.

Upvotes: 0

Alexandr Lazarev
Alexandr Lazarev

Reputation: 12882

The issue can be with the wrong port. I had two ports set for listening in my sphinx.config:

searchd{
   listen = 9312
   listen = 9306:mysql41
}

When I've tried to connect via 9306 port, I got the error mentioned above. Changing it to 9312 solved the problem.

Upvotes: 0

Alexandr Teise
Alexandr Teise

Reputation: 21

First of all make shure that you use suitable ip for api library. What ip is using you can see into

sphinx.config section searchd{}.

If it is ok next step is to see sphinx status

searchd --status

Upvotes: 0

Philippe
Philippe

Reputation: 106

I just had the same issue on my server, and I realized I did not start the searchd daemon at all.

Hope this helps

Upvotes: 9

Related Questions