Skip to content

Instantly share code, notes, and snippets.

0x26BC58c4E46A9C63FCA6658059F994545abF0bE5
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ipatovanton
ipatovanton / gist:0b34bdfc036fc6f4b9897985ebb0dc0f
Created February 11, 2018 17:59
Mongo::Error::NoServerAvailable: No server is available matching preference
Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x70190986379200 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/server_selector/selectable.rb:115:in `select_server'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/collection/view/readable.rb:139:in `block in count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/retryable.rb:44:in `read_with_retry'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongo-2.5.0/lib/mongo/collection/view/readable.rb:138:in `count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:71:in `block in count'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:522:in `try_cache'
from /Users/ipatov/.rvm/gems/ruby-2.4.1/gems/mongoid-6.1.1/lib/mongoid/contextual/mongo.rb:71:in `count'
from /Users/ipat