resque / resque-pool

quickly fork a pool resque workers, saving memory (w/REE) and monitoring their uptime.
http://rubygems.org/gems/resque-pool
MIT License
456 stars 152 forks source link

ActiveRecord::ConnectionNotEstablished #65

Open kcm opened 11 years ago

kcm commented 11 years ago

Using sqlite3 everywhere but production, and everything else is running fine, but I'm seeing this error in development. Any ideas? Seems like this shouldn't happen with a functioning sqlite3 setup (created, migrated, etc).

$ resque-pool --environment development
resque-pool-manager[xxx][77466]: Resque Pool running in development environment
/Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
    from /Users/kcm/src/distill/distill/lib/tasks/resque.rake:38:in `block in <top (required)>'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
    from /Users/kcm/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:187:in `block in invoke_prerequisites'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:185:in `each'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:185:in `invoke_prerequisites'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:165:in `block in invoke_with_call_chain'
    from /Users/kcm/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/resque-pool-0.3.0/lib/resque/pool/cli.rb:114:in `start_pool'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/resque-pool-0.3.0/lib/resque/pool/cli.rb:16:in `run'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/gems/resque-pool-0.3.0/bin/resque-pool:7:in `<top (required)>'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/bin/resque-pool:19:in `load'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/bin/resque-pool:19:in `<main>'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/kcm/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
kcm commented 11 years ago

Found an issue: if I disable the New Relic agent in development, things work.

newrelic.yml:

development:
  agent_enabled: false

Perhaps this is a NR agent bug? Contacting NR directly now and will update with the outcome.

ScotterC commented 11 years ago

@kcm Did you happen to figure out the problem with this

kcm commented 11 years ago

Never heard back from NR but it seems to work now, though I'm not using resque-pool at the moment.

ScotterC commented 11 years ago

I got the same error but it was from rake tasks configured wrong. Fixed now. Thanks for following up

joshillian commented 8 years ago

Thanks for this ScotterC -- your comment got me looking at the rake tasks and I found a line that was causing this.