Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-891

Can't connect the driver to mongos if :connect option is omitted.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      CentOS 6.4
      MongoDB 3.0.1 (authentication mechanism : SCRAM-SHA-1)
      Ruby 2.1.2

      Description

      Can't connect the driver to mongos if :connect option is omitted.
      Auto-discovery mechanism may not work.
      The following code runs correctly, If ':connect => :sharded' is specified in Mongo::Client.new option,

      1. Ruby Code
        > db = Mongo::Client.new(
        ['test-server:20001'],
        :database => "admin",
        :user => "admin_user",
        :password => "admin_pass")
        > db["test_col"].find.count

      Mongo::ServerSelector::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x00000002a12258 @tag_sets=[], @options={:database=>"test", :user=>"admin_user", :password=>"admin_pass"}, @server_selection_timeout=30>
      from /home/dep/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.2/lib/mongo/server_selector/selectable.rb:99:in `select_server'
      from /home/dep/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.2/lib/mongo/database.rb:130:in `command'
      from /home/dep/.rvm/gems/ruby-2.1.2/gems/mongo-2.0.2/lib/mongo/collection/view/readable.rb:124:in `count'
      :

        Attachments

          Activity

            People

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            incredible_hana Onari Tanaka
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: