-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.3, 2.0.4
-
Component/s: Replica Set
-
Environment:Mac OSX
Ruby 2.1.2
Whenever connecting to a secondary host.
This is reproduced by either
- connecting directly to secondary host
- connecting to a replica set with read preference :secondary/secondary_preferred
Here is the reproducing command with error and stack trace
c = Mongo::Client.new(=> ["host1:port2,host2:port2"]
, {:database => 'dbname', :read => {:mode => :secondary}, :replica_set => 'set-name'}).with({:user=>"user", :password=>"pass"})
c['collection'].find.aggregate([{:$limit => 1}]).allow_disk_use(true).each
D, 2015-05-26T10:42:24.257309 #46561 DEBUG – : MONGODB | COMMAND | namespace=session-default.$cmd selector={:getnonce=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 146.3048ms
D, 2015-05-26T10:42:24.404846 #46561 DEBUG – : MONGODB | COMMAND | namespace=session-default.$cmd selector={:authenticate=>1, :user=>"user", :nonce=>"value", :key=>"key"} flags=[] limit=-1 skip=0 project=nil | runtime: 147.1751ms
D, 2015-05-26T10:42:24.551613 #46561 DEBUG – : MONGODB | COMMAND | namespace=session-default.$cmd selector={:aggregate=>"client_infos", :pipeline=>[{:$limit=>1}], :cursor=>{}, :allowDiskUse=>true} flags=[] limit=-1 skip=0 project=nil | runtime: 587.5208ms
Mongo::Error::OperationFailure: not master ()
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/operation/result.rb:214:in `validate!'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/operation/aggregate.rb:75:in `block in execute_message'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/server/connection_pool.rb:99:in `with_connection'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/server/context.rb:63:in `with_connection'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/operation/aggregate.rb:74:in `execute_message'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/operation/aggregate.rb:68:in `execute'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/collection/view/aggregation.rb:98:in `send_initial_query'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.4/lib/mongo/collection/view/iterable.rb:39:in `each'
from (irb):7
from /Users/inbar/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<top (required)>'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/ruby-debug-ide-0.4.28/lib/ruby-debug-ide.rb:86:in `debug_load'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/ruby-debug-ide-0.4.28/lib/ruby-debug-ide.rb:86:in `debug_program'
from /Users/inbar/.rvm/gems/ruby-2.1.2/gems/ruby-debug-ide-0.4.28/bin/rdebug-ide:121:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'