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

jerrod's Avatar

jerrod

28 Aug, 2012 02:49 PM

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. 1 Posted by jerrod on 28 Aug, 2012 02:58 PM

    jerrod's Avatar

    thats "cleardb" - autocorrect fail.

  2. 2 Posted by jerrod on 28 Aug, 2012 02:59 PM

    jerrod's Avatar

    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. Support Staff 3 Posted by Pat Allan on 28 Aug, 2012 03:02 PM

    Pat Allan's Avatar

    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. 4 Posted by jerrod on 28 Aug, 2012 03:27 PM

    jerrod's Avatar

    yep sure is:

    DATABASE_URL             => mysql2://xxxxxxxxxx:[email blocked]/heroku_xxxxxxxxxxxxx?reconnect=true
    
  5. 5 Posted by jerrod on 28 Aug, 2012 04:41 PM

    jerrod's Avatar

    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. 6 Posted by jerrod on 28 Aug, 2012 04:43 PM

    jerrod's Avatar
    ➜ ~/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. 7 Posted by jerrod on 28 Aug, 2012 05:01 PM

    jerrod's Avatar

    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. 8 Posted by jerrod on 28 Aug, 2012 05:02 PM

    jerrod's Avatar

    oh - app name is "signmeto-roadrunner"

  9. Support Staff 9 Posted by Pat Allan on 28 Aug, 2012 05:20 PM

    Pat Allan's Avatar

    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. 10 Posted by jerrod on 28 Aug, 2012 06:24 PM

    jerrod's Avatar

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

    testing all my indices now.

    Much appreciated, Pat!

  11. Support Staff 11 Posted by Pat Allan on 28 Aug, 2012 06:27 PM

    Pat Allan's Avatar

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

  12. Support Staff 12 Posted by Pat Allan on 28 Aug, 2012 10:40 PM

    Pat Allan's Avatar

    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. 13 Posted by jerrod on 28 Aug, 2012 10:43 PM

    jerrod's Avatar

    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