bkeepers / qu

a Ruby library for queuing and processing background jobs.
MIT License
506 stars 50 forks source link

db_name must be a string or symbol #64

Closed Bramanga closed 10 years ago

Bramanga commented 11 years ago

I'm not sure why I'm getting this now, but it seems to have just started happening. My app is running on Heroku and my app connects just fine to MongoHQ using this: MongoMapper.config = { Rails.env => { 'uri' => ENV['MONGOHQ_URL'] } }. However, whenever I try to create a Qu job (or even check the length), it throws this error:

pry(main)>Qu.length
TypeError: db_name must be a string or symbol
from /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/support.rb:49:in `validate_db_name'

My config/qu.rb looks like this:

Qu.configure do |c|
  # if ENV['MONGOHQ_URL']
  #   c.connection  = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
  # else
  #   c.connection  = Mongo::Connection.new('localhost', 27017).db("action-log-#{Rails.env}")
  # end
  # if Rails.env == "staging"
  #   c.connection = Mongo::Connection.from_uri("--uri removed--")
  # end
  c.logger = Logger.new('log/qu.log')
end

I can't seem to figure out what is causing this. It would seem that the db_name is not getting set properly and is probably nil, causing the validation error to fire. But this configuration used to work just fine.

Any help would be appreciated. Thanks.

Update: added a backtrace

[5] pry(main)> Qu.length
TypeError: db_name must be a string or symbol
from /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/support.rb:49:in `validate_db_name'
[6] pry(main)> wtf?
Exception: TypeError: db_name must be a string or symbol
--
0: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/support.rb:49:in `validate_db_name'
1: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/db.rb:91:in `initialize'
2: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `new'
3: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `[]'
4: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:244:in `block in apply_saved_authentication'
5: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `each'
6: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `apply_saved_authentication'
7: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:174:in `checkout_new_socket'
8: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:272:in `block (2 levels) in checkout'
9: <internal:prelude>:10:in `synchronize'
[7] pry(main)>

Update: better backtrace

2013-06-10T18:36:57.072430+00:00 app[web.1]: Started GET "/hirefire/hirefiretoken/info" for 99.109.254.3 at 2013-06-10 14:36:57 -0400
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/support.rb:49:in `validate_db_name'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/db.rb:91:in `initialize'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `new'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `[]'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:244:in `block in apply_saved_authentication'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `each'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `apply_saved_authentication'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:174:in `checkout_new_socket'
2013-06-10T18:36:57.083486+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:272:in `block (2 levels) in checkout'
2013-06-10T18:36:57.083486+00:00 app[web.1]: <internal:prelude>:10:in `synchronize'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:263:in `block in checkout'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:256:in `loop'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:256:in `checkout'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:530:in `checkout_reader'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:541:in `checkout_socket_from_connection'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:469:in `block in send_initial_query'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:33:in `block in instrument'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:65:in `instrument'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:32:in `instrument'
2013-06-10T18:36:57.083659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:466:in `send_initial_query'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:451:in `refresh'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:110:in `next'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/db.rb:527:in `command'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:173:in `count'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/collection.rb:963:in `count'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-mongo-0.2.0/lib/qu/backend/mongo.rb:55:in `length'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/config/initializers/hirefire.rb:4:in `block (2 levels) in <top (required)>'
2013-06-10T18:36:57.066828+00:00 heroku[router]: at=info method=GET path=/hirefire/hirefiretoken/info host=blooming-rain-6086.herokuapp.com fwd="99.109.254.3" dyno=web.1 connect=2ms service=22ms status=200 bytes=35
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:53:in `call'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:53:in `block in dynos'
2013-06-10T18:36:57.083811+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `each'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `inject'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `dynos'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:42:in `each'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:58:in `digest_body'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:26:in `call'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
2013-06-10T18:36:57.084226+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__2616270529350534789__call__644675313378680830__callbacks'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-06-10T18:36:57.084380+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-06-10T18:36:57.084695+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in `call'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-ssl-1.3.3/lib/rack/ssl.rb:27:in `call'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `block in call'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
2013-06-10T18:36:57.084871+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `call'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/log_tailer.rb:17:in `call'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:81:in `block in pre_process'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `catch'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `pre_process'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:54:in `process'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:39:in `receive_data'
2013-06-10T18:36:57.085210+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/server.rb:159:in `start'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in `run'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2013-06-10T18:36:57.085360+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2013-06-10T18:36:57.085360+00:00 app[web.1]: script/rails:6:in `require'
2013-06-10T18:36:57.085715+00:00 app[web.1]: script/rails:6:in `<main>'
2013-06-10T18:37:17.867331+00:00 app[web.1]: Started GET "/hirefire/hirefiretoken/info" for 184.72.165.101 at 2013-06-10 14:37:17 -0400
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/support.rb:49:in `validate_db_name'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/db.rb:91:in `initialize'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `new'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:348:in `[]'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:244:in `block in apply_saved_authentication'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `each'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:243:in `apply_saved_authentication'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:174:in `checkout_new_socket'
2013-06-10T18:37:17.870096+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:272:in `block (2 levels) in checkout'
2013-06-10T18:37:17.870096+00:00 app[web.1]: <internal:prelude>:10:in `synchronize'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:263:in `block in checkout'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:256:in `loop'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/pool.rb:256:in `checkout'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/mongo_client.rb:530:in `checkout_reader'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:541:in `checkout_socket_from_connection'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:469:in `block in send_initial_query'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:33:in `block in instrument'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:65:in `instrument'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/util/logging.rb:32:in `instrument'
2013-06-10T18:37:17.870280+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:466:in `send_initial_query'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:451:in `refresh'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:110:in `next'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/db.rb:527:in `command'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/cursor.rb:173:in `count'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.8.6/lib/mongo/collection.rb:963:in `count'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-mongo-0.2.0/lib/qu/backend/mongo.rb:55:in `length'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/config/initializers/hirefire.rb:4:in `block (2 levels) in <top (required)>'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:53:in `call'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:53:in `block in dynos'
2013-06-10T18:37:17.870434+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `each'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `inject'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:52:in `dynos'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/hirefire-resource-0.1.1/lib/hirefire/middleware.rb:42:in `each'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:58:in `digest_body'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:26:in `call'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
2013-06-10T18:37:17.870835+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__2616270529350534789__call__644675313378680830__callbacks'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2013-06-10T18:37:17.870988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2013-06-10T18:37:17.871306+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in `call'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-ssl-1.3.3/lib/rack/ssl.rb:27:in `call'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `block in call'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
2013-06-10T18:37:17.871458+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `call'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/rack/log_tailer.rb:17:in `call'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:81:in `block in pre_process'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `catch'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `pre_process'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:54:in `process'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:39:in `receive_data'
2013-06-10T18:37:17.871762+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/server.rb:159:in `start'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in `run'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2013-06-10T18:37:17.871911+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2013-06-10T18:37:17.871911+00:00 app[web.1]: script/rails:6:in `require'
2013-06-10T18:37:17.872253+00:00 app[web.1]: script/rails:6:in `<main>'
Bramanga commented 11 years ago

I decided to run the tests and get a failure when using the MONGOHQ_URL, which is what I am using on Heroku.

Failures:

  1) Qu::Backend::Mongo connection should use MONGOHQ_URL from heroku
     Failure/Error: subject.connection.connection.host_to_try.should == ['host', 10060]
       expected: ["host", 10060]
            got: nil (using ==)
     # ./spec/qu/backend/mongo_spec.rb:22:in `block (3 levels) in <top (required)>'

Finished in 1.58 seconds
36 examples, 1 failure

Failed examples:

rspec ./spec/qu/backend/mongo_spec.rb:17 # Qu::Backend::Mongo connection should use MONGOHQ_URL from heroku
brianhempel commented 11 years ago

I'd work from here: https://github.com/bkeepers/qu/blob/master/lib/qu/backend/mongo.rb#L24

Check: Is ENV['MONGOHQ_URL'] getting set? What is @auths in https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/mongo_client.rb#L272 ? It's in the backtrace. (Rescue the error and spew Qu.backend.connection.connection.auths to find out)

norbert commented 11 years ago

This is closely related to issue #63 which I discovered two months ago. As I mentioned there the Mongo backend is not of interest to me but the issue has something to do with a change in the client gem.

Can you verify that there is no problem when using 1.8.0 instead of 1.8.6?

Bramanga commented 11 years ago

I was able to roll the mongo gem back to 1.8.3 and it appears to be working. I get this same error when using 1.8.4 and 1.8.6. I haven't tried 1.8.5 or 1.8.0.

I can confirm that when running the tests, the MONGOHQ_URL is getting set properly and parsed by the connection method. I think that the connection specs might have changed in the mongo ruby driver between versions 1.8.3 and 1.8.4. I will try to run the tests under both of these versions and post the results.

I did notice while digging around in there that after mongo 2, the Connection method will be deprecated for the MongoClient method: http://api.mongodb.org/ruby/current/Mongo/Connection.html. So, I'm thinking that this should probably be updated as well.

My Gemfile (working configuration):

*** LOCAL GEMS ***

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
addressable (2.3.4)
angularjs-rails (1.0.6.1)
arel (3.0.2)
aws-s3 (0.6.3)
bcrypt-ruby (3.0.1)
better_errors (0.8.0)
bigdecimal (1.1.0)
binding_of_caller (0.7.1)
bootstrap-sass-rails (2.3.2.0)
brakeman (2.0.0)
bson (1.8.6)
bson_ext (1.8.6)
builder (3.0.4)
bundler (1.3.2)
callsite (0.0.11)
cancan (1.6.10)
capybara (2.1.0)
carrierwave (0.8.0)
chronic (0.9.1)
coderay (1.0.9)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
cucumber (1.3.1)
cucumber-rails (1.3.1)
daemons (1.1.9)
dalli (2.6.3)
database_cleaner (1.0.1)
debug_inspector (0.0.2)
delayed_job (3.0.5)
devise (2.2.4)
diff-lcs (1.2.4)
erubis (2.7.0)
eventmachine (1.0.3)
excon (0.22.1)
execjs (1.4.0)
factory_girl (4.2.0)
factory_girl_rails (4.2.1)
fastercsv (1.5.5)
fog (1.11.1)
formatador (0.2.4)
formtastic (2.2.1)
gherkin (2.12.0)
haml (4.0.3)
haml-rails (0.4)
hashr (0.0.22)
highline (1.6.19)
hike (1.2.2)
hirefire-resource (0.1.1)
i18n (0.6.1)
io-console (0.3)
jasmine-core (1.3.1)
jasmine-rails (0.4.3)
journey (1.0.4)
jquery-datatables-rails (1.11.2)
jquery-fileupload-rails (0.4.1)
jquery-rails (2.2.1)
json (1.8.0, 1.5.5)
kaminari (0.13.0)
launchy (2.3.0)
mail (2.5.4)
meta_request (0.2.5)
method_source (0.8.1)
mime-types (1.23)
mini_magick (3.6.0)
minitest (2.5.1)
mm-carrierwave (0.0.2)
mm-devise (2.0)
mongo (1.8.3)
mongo_mapper (0.12.0)
mongo_mapper_ext (0.2.7)
mongo_sequence (1.0.1)
mongo_session_store-rails3 (4.0.0)
multi_json (1.7.3)
net-scp (1.1.1)
net-ssh (2.6.7)
newrelic_rpm (3.6.2.96)
nokogiri (1.5.9)
orm_adapter (0.4.0)
pdfkit (0.5.2)
plucky (0.5.2)
polyglot (0.3.3)
pry (0.9.12.2)
pry-nav (0.2.3)
pry-rails (0.3.0)
pry-stack_explorer (0.4.9)
qu (0.2.0)
qu-mongo (0.2.0)
rack (1.4.5)
rack-cache (1.2)
rack-contrib (1.1.0)
rack-ssl (1.3.3)
rack-test (0.6.2)
rack-timeout (0.0.4)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4, 0.9.2.2)
rb-readline (0.4.2)
rdoc (3.12.2, 3.9.5)
rest-client (1.6.7)
rmagick (2.13.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
ruby-hmac (0.4.0)
ruby2ruby (2.0.5)
ruby_parser (3.1.3)
sanitize (2.0.3)
sass (3.2.9)
sass-rails (3.2.6)
sexp_processor (4.2.1)
slim (1.3.9)
slop (3.4.5)
sprockets (2.2.2)
sprockets-rails (0.0.1)
subexec (0.2.3)
temple (0.6.5)
terminal-table (1.4.5)
thin (1.5.1)
thor (0.18.1)
tilt (1.4.1)
tire (0.4.1)
treetop (1.4.12)
tzinfo (0.3.37)
uglifier (2.1.1)
warden (1.2.1)
wicked_pdf (0.9.6)
wkhtmltopdf-binary (0.9.9.1)
xml-simple (1.1.2)
xpath (2.0.0)
yajl-ruby (1.1.0)
bkeepers commented 11 years ago

A pull request to fix it would be appreciated if you get it working.

jnunemaker commented 10 years ago

This can be closed since the pull above was merged.