-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
What I do:
@connection = Mongo::Client.new( ["localhost:27017"], :pool_size => 10, :database => "db_name" ) @collection = @connection.use(@database_name).database["sunspot_index_queue_entries"] @collection.indexes.ensure(:record_class_name => Mongo::Index::ASCENDING, :record_id => Mongo::Index::ASCENDING)
What I get:
~/.rvm/gems/ruby-2.1.2@carmen/bundler/gems/mongo-ruby-driver-9c8b06c2d694/lib/mongo/server_preference/selectable.rb:82:in `block in primary': undefined method `primary?' for nil:NilClass (NoMethodError) from ~/.rvm/gems/ruby-2.1.2@carmen/bundler/gems/mongo-ruby-driver-9c8b06c2d694/lib/mongo/server_preference/selectable.rb:82:in `select' from ~/.rvm/gems/ruby-2.1.2@carmen/bundler/gems/mongo-ruby-driver-9c8b06c2d694/lib/mongo/server_preference/selectable.rb:82:in `primary' from ~/.rvm/gems/ruby-2.1.2@carmen/bundler/gems/mongo-ruby-driver-9c8b06c2d694/lib/mongo/cluster.rb:110:in `next_primary' from ~/.rvm/gems/ruby-2.1.2@carmen/bundler/gems/mongo-ruby-driver-9c8b06c2d694/lib/mongo/index/view.rb:107:in `ensure'
The problem (in Mongo::Server::Description):
def standalone? replica_set_name.nil? && !mongos? && !ghost? && !unknown? end
This part !unknown? is always false because in Mongo::Server you do:
@description = Description.new(self) # not passing any config
And the unknown? method checks exactly for empty configs.