resque-pool icon indicating copy to clipboard operation
resque-pool copied to clipboard

ActiveRecord::ConnectionNotEstablished

Open kcm opened this issue 13 years ago • 5 comments

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 avatar Dec 21 '12 00:12 kcm

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.

kcm avatar Dec 21 '12 01:12 kcm

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

ScotterC avatar Mar 21 '13 15:03 ScotterC

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

kcm avatar Mar 21 '13 17:03 kcm

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

ScotterC avatar Mar 21 '13 17:03 ScotterC

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

joshillian avatar Dec 31 '15 03:12 joshillian