ThinkingSphinx ConnectionError

Hi,

I am using rails 2.3 and ruby 1.8.6 with radiant cms

Here for searching i am using thinking sphinx, this is been working fine for me, But suddenly this functionality as been broken, This is the issue I am getting,

Can anyone help me to sort out this,

Querying Sphinx: 50009

ThinkingSphinx::ConnectionError (Connection to Sphinx Daemon (searchd) failed.):
.//vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:236:in populate' .//vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:310:in call’
.//vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:310:in retry_on_stale_index' .//vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:231:in populate’
.//vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:96:in method_missing' /srv/rails/redken/trunk/vendor/extensions/redken/app/controllers/professional/search_controller.rb:15:in index’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1101:in send' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1101:in perform_action_without_filters’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in call_filters' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:688:in perform_action_without_benchmark’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue' /home/gopinath/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/1.8/benchmark.rb:293:in measure’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in perform_action’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:435:in send' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:435:in process_without_filters’
.//vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:684:in process_without_session_management_support' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in sass_old_process’
/srv/rails/redken/trunk/vendor/extensions/templates/vendor/plugins/haml/lib/sass/plugin.rb:159:in process' .//vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:334:in process’
.//vendor/radiant/vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in process’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/bin/…/lib/mongrel/rails.rb:74:in synchronize' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in process’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:159:in process_client' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:158:in each’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:158:in process_client' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:285:in initialize' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:285:in new’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:268:in initialize’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel.rb:268:in run’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in run' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in each’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in run' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/bin/mongrel_rails:128:in run’
/home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in run' /home/gopinath/.rvm/gems/ruby-1.8.6-p420@redken/gems/mongrel-1.1.5/bin/mongrel_rails:281 .//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in load’
.//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in load' .//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in new_constants_in’
.//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in load' .//vendor/radiant/vendor/rails/railties/lib/commands/servers/mongrel.rb:60 /home/gopinath/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in gem_original_require’
/home/gopinath/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in require' .//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in require’
.//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in new_constants_in' .//vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in require’
.//vendor/radiant/vendor/rails/railties/lib/commands/server.rb:39
script/server:3:in `require’
script/server:3

Thanks in advance…

Best Regards,

Gopinath M

There must be some error in the thinking_sphinx.yml

Hi Vivek,

Here is my sphinx.yml, but this is working for me before...

development: &dev
  html_strip: 1
  enable_star: 1
  html_remove_elements: script
  mem_limit: 64M
  morphology: stem_en

test:
  <<: *dev

staging:
  bin_path: /usr/local/bin/
  # pid_file: /etc/service/searchd/supervise/pid
  <<: *dev

production:
  bin_path: /usr/local/bin/
  pid_file: /etc/service/searchd/supervise/pid
  <<: *dev

Are you running this on production or in development. Can you find the PID file which is listed in the yml file ? /etc/service/searchd/supervise/pid

Running this in Development. I can’t able to find the PID.

So "suddenly" you're getting a connection failure?

Are you sure that searchd is still running? Is it logging any errors?
Can you connect to it via any other client?

I have fixed this by killing the searchd and again started it.

Uh, well. I wouldn't say "fixed" if you don't know why your searchd
instance became unresponsive and you haven't taken appropriate
steps to insure that it doesn't happen again :slight_smile:

But good luck!

Thanks all :slight_smile: