Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-487

NoMethodError - undefined method `-' for nil:NilClass in pool_manager.rb:259

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: 1.7.0
    • Component/s: None
    • None

      After upgrading to mongo driver version 1.7.0 I get the following error on the first request after restarting web processes. Subsequent requests work fine. I'm using Ruby 1.9.3 and Mongoid 2.5.0

      Stack trace:

      Error: NoMethodError - undefined method `-' for nil:NilClass

      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/pool_manager.rb:259:in `block in near_pool'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/pool_manager.rb:258:in `select'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/pool_manager.rb:258:in `near_pool'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/pool_manager.rb:253:in `select_pool'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/pool_manager.rb:119:in `read_pool'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/repl_set_connection.rb:411:in `read_pool'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/repl_set_connection.rb:341:in `block in checkout_reader'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/repl_set_connection.rb:324:in `checkout'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/repl_set_connection.rb:340:in `checkout_reader'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/cursor.rb:542:in `checkout_socket_from_connection'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/cursor.rb:477:in `block in send_initial_query'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/util/logging.rb:32:in `instrument'
      /app/vendor/bundle/ruby/1.9.1/gems/rpm_contrib-2.1.11/lib/rpm_contrib/instrumentation/mongo.rb:26:in `block in instrument_with_newrelic_trace'
      /app/vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.5.0/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
      /app/vendor/bundle/ruby/1.9.1/gems/rpm_contrib-2.1.11/lib/rpm_contrib/instrumentation/mongo.rb:24:in `instrument_with_newrelic_trace'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/cursor.rb:473:in `send_initial_query'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/cursor.rb:458:in `refresh'
      /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.7.0/lib/mongo/cursor.rb:127:in `next'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/cursor.rb:49:in `block in each'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/collections/retry.rb:29:in `retry_on_connection_failure'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/cursor.rb:48:in `each'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/contexts/mongo.rb:262:in `block in iterate'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/contexts/mongo.rb:480:in `selecting'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/contexts/mongo.rb:259:in `iterate'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/criteria.rb:145:in `block in each'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/criteria.rb:145:in `tap'
      /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.5.0/lib/mongoid/criteria.rb:145:in `each'

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            fbjork Fredrik Björk
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: