Using Flying Sphinx with rails 2.3 & cleared (cloud mysql add-on)

I am migrating an app from engineyard and am attempting to setup flying sphinx.

when i hit a url that uses the sphinx search i see:

Connection to ec2-184-72-209-147.compute-1.amazonaws.com on 9336 failed. Connection refused - connect(2)

And when i try to run any of the rake tasks on the heroku instance i see:

Running rake ts:conf --trace attached to terminal... up, run.1
** Invoke ts:conf (first_time)
** Invoke thinking_sphinx:configure (first_time)
** Invoke thinking_sphinx:app_env (first_time)
** Execute thinking_sphinx:app_env
** Invoke environment (first_time)
** Execute environment
rake aborted!
production database is not configured
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:438:in `initialize_database'
/app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:141:in `process'
/app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
/app/config/environment.rb:9:in `<top (required)>'
  1. thats "cleardb" - autocorrect fail.

  2. note the same error when running the FS index task

    ➜ ~/Sites/signmeto-roadrunner git:(master) ✗ (ruby-1.9.2-p320@signmeto) heroku run rake fs:index --trace 
    Running rake fs:index --trace attached to terminal... up, run.1
    ** Invoke fs:index (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    rake aborted!
    production database is not configured
    /app/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
    /app/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
    /app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:438:in `initialize_database'
    /app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:141:in `process'
    /app/vendor/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
    /app/config/environment.rb:9:in `<top (required)>'
    
  3. Hi Jerrod

    You'll definitely need to stick with the fs tasks. Is your DATABASE_URL environment variable set to your cleardb database connection?

    Pat

  4. yep sure is:

    DATABASE_URL             => mysql2://xxxxxxxxxx:[email blocked]/heroku_xxxxxxxxxxxxx?reconnect=true
    
  5. trying the CLI commands from the docs:

    ➜ ~/Sites/signmeto-roadrunner git:(master) (ruby-1.9.2-p320@signmeto) heroku run flying-sphinx index      
    Running flying-sphinx index attached to terminal... up, run.3
    Index Request has completed:
    Sphinx 1.10-beta (r2420)
    Copyright (c) 2001-2010, Andrew Aksyonoff
    Copyright (c) 2008-2010, Sphinx Technologies Inc (http://sphinxsearch.com)
    
    using config file '/mnt/local/flying-sphinx/89aca395d2e09a53b/sphinx.conf'...
    FATAL: no indexes found in config file '/mnt/local/flying-sphinx/89aca395d2e09a53b/sphinx.conf'
    

    and from the app log:

    Connection to ec2-184-72-209-147.compute-1.amazonaws.com on 9336 failed. Connection refused - connect(2)
    

    What other info would be helpful in troubleshooting this?

  6. ➜ ~/Sites/signmeto-roadrunner git:(master) (ruby-1.9.2-p320@signmeto) heroku run console
    Running console attached to terminal... up, run.3
    Loading production environment (Rails 2.3.14)
    >> ThinkingSphinx.search
    Riddle::ConnectionError: Connection to ec2-184-72-209-147.compute-1.amazonaws.com on 9336 failed. Connection refused - connect(2)
    
  7. i turned on verbose logging and now i see this:

    
    ➜ ~/Sites/signmeto-roadrunner git:(master) ✗ (ruby-1.9.2-p320@signmeto) heroku run flying-sphinx restart
    Running flying-sphinx restart attached to terminal... up, run.4
    /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.1/lib/flying_sphinx/api.rb:75:in `log_message': undefined method `zone' for Time:Class (NoMethodError)
    
  8. oh - app name is "signmeto-roadrunner"

  9. I've just released flying-sphinx 0.8.2 which should handle the zone method not existing. I'm not convinced that's the cause of the original error though… I'm at a bit of a loss for that. Still, give this a shot, see how you go. Let me know what the verbose output of the fs:rebuild task is.

    Thanks

    Pat

  10. tracked it down to what appears to be a poorly written rake task.

    testing all my indices now.

    Much appreciated, Pat!

  11. Ah, great to hear. If you hit any further issues, just let me know.

  12. The app works fine otherwise, though? There's nothing in the stack trace that's suggesting it's a bug from Flying Sphinx's perspective, but it's odd that the database isn't set up in this situation…

    Pat

  13. yeah - nothing that i consider to be flying sphinx or thinking sphinx's issue. I think i just got "lucky" in that i didn't have any other rake tasks that needed to run on heroku.

    Really appreciate your help, regardless!

  14. Pat Allan closed this discussion on 13 Jan, 2014 11:26 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