highgroove/scout-plugins — Issue #45: connection failure with mongo gem 1.5.2
Author: danieldkim
Created: 2012-01-11 21:19:37+00:00
State: open

here's the stack trace:

Mongo::ConnectionFailure: Cannot connect to a replica set using seeds localhost:27017
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:282:in `get_valid_seed_node'
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:158:in `connect_to_members'
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:30:in `connect'
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:160:in `connect'
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:500:in `setup'
/usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:144:in `initialize'
MongoDB Slow Queries:64:in `new'
MongoDB Slow Queries:64:in `build_report'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/plugin.rb:210:in `run'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/server.rb:378:in `process_plugin'
/usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/server.rb:377:in `process_plugin'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/server.rb:281:in `run_plugins_by_plan'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/server.rb:279:in `each'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/server.rb:279:in `run_plugins_by_plan'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/command/run.rb:31:in `run'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/lib/scout/command.rb:144:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/scout-5.3.3/bin/scout:10
/usr/bin/scout:19:in `load'
/usr/bin/scout:19

if i trying using the old pre-1.5.1 method of connecting from the console it works:

irb(main):010:0> server = "localhost"; port = 27017
=> 27017
irb(main):011:0> Mongo::ReplSetConnection.new([server,port.to_i], :read_secondary => true)
:read_secondary options has now been deprecated and will be removed in driver v2.0. Use the :read option instead.
Mongo::ConnectionFailure: Cannot connect to a replica set using seeds localhost:27017
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:282:in `get_valid_seed_node'
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:158:in `connect_to_members'
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:30:in `connect'
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:160:in `connect'
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:500:in `setup'
from /srv/toura_api/shared/bundle/ruby/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:144:in `initialize'
from (irb):11:in `new'
from (irb):11
irb(main):012:0> Mongo::Connection.new(server,port.to_i)
=> #, @op_timeout=nil, @pool_timeout=5.0, @ssl=false, @max_bson_size=16777216, @primary=["localhost", 27017], @queue=#, @pool_size=1, @connection_mutex=#, @slave_ok=nil, @connect_timeout=nil, @logger=nil, @safe=false, @socket_class=TCPSocket, @host=nil, @auths=[], @port=nil, @id_lock=#, @read_primary=true, @host_to_try=["localhost", 27017]>
irb(main):013:0>