Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4513

Mongo::Error::NoServerAvailable: No server is available matching preference

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.3.0
    • Component/s: None
    • None

      I'm getting the following error when updating to mongoid 6.3 and mongo 2.5:

      Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x70187931651200 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongo-2.5.0/lib/mongo/server_selector/selectable.rb:115:in `select_server'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongo-2.5.0/lib/mongo/collection/view/iterable.rb:42:in `block in each'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongo-2.5.0/lib/mongo/retryable.rb:44:in `read_with_retry'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongo-2.5.0/lib/mongo/collection/view/iterable.rb:40:in `each'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/query_cache.rb:222:in `each'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/contextual/mongo.rb:278:in `first'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/contextual/mongo.rb:278:in `find_first'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/contextual.rb:20:in `find_first'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/findable.rb:114:in `find_by'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/criteria.rb:502:in `block in method_missing'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/scopable.rb:230:in `with_scope'
      /Users/dcuadrado/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/mongoid-6.3.0/lib/mongoid/criteria.rb:501:in `method_missing'

      it works well with previous version.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            david.cuadrado David Cuadrado
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: