ConnectionError -- seems to be trying to connect to 127.0.0.1, not the FLYING_SPHINX_HOST

I think must not have configured flying sphinx correctly, but I do not see in the docs how to troubleshoot this issue.

I am running rails 3.2.3, flying-sphinx 0.8.4, thinking-sphinx 2.0.11

I am unclear what, if anything, should be in my local config/sphinx.yml. Right now it has a section for production with port: <%= ENV['FLYING_SPHINX_PORT'] and host: <%= ENV['FLYING_SPHINX_PORT'] %>

If I do a heroku run console and try to search, though, I get a Riddle::ConnectionError saying it is unable to connect to 127.0.01. I also see the message saying: "Riddle cannot detect Sphinx on your machine...". The exact error message I get it: "Riddle::ConnectionError: Connection to 127.0.0.1 on 9338 failed. Connection refused - connect(2)"

I tried fixing the settings by hand on the heroku console like so:
config = ThinkingSphinx::Configuration.instance
config.port =
config.address =

After that if I do a User.search('something') I no longer get the ConnectionError, but I get this error instead: "Riddle::ResponseError: searchd error (status: 1): invalid client key ''"

Any ideas? App name is 'ourgoods'

  1. Hi Cory

    You're the second person lately I've heard of who's had a problem like this... for some reason, it sounds like the Railtie that sets up Thinking Sphinx with Flying Sphinx's connection details isn't being loaded.

    I'm not yet sure why this is happening - I've not seen it happen on a wider level. Would it be possible to get access to your app so I can investigate directly, see if I can pinpoint the exact cause? My heroku account is [email blocked]. If not, no worries, we can try to figure out a work-around.

    Kind regards

    Pat

  2. Sure thing -- I just added you.

    thanks,
    Cory

  3. Hi Cory

    I found the reason why - you've got the flying-sphinx gem within the deployment group in your Gemfile, and so it's not being loaded by default. I'd recommend having it always loaded - it won't do anything unless the FLYING_SPHINX_* configuration variables (supplied on Heroku) are available, so there's no harm having it loaded in the development and test environments.

    Give it a spin like that and see how things go.

    Cheers

    Pat

  4. I'm having the same issue, but flying sphinx is not under any groups.

  5. I'm using an initializer to configure Sphinx rather then the yml files. I thought that might be messing with the flying sphinx config. Changing it to the following resolved my issue:

    ThinkingSphinx.suppress_delta_output = true
    ThinkingSphinx.remote_sphinx = true
    ts_config = ThinkingSphinx::Configuration.instance
    ts_config.use_64_bit = true

    fs_config = FlyingSphinx::Configuration.new

    ts_config.address = fs_config.host
    ts_config.port = fs_config.port
    ts_config.configuration.searchd.client_key = fs_config.client_key

  6. Pat Allan closed this discussion on 13 Jan, 2014 11:24 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions