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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: 6.3.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: