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

Authenticating with only secondary fails

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.6.2
    • Affects Version/s: 1.6.1
    • Component/s: None
    • Environment:
      Ubuntu, jruby
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a 3 node replica set and have taken down two nodes which leaves me with one node marked as a secondary.

      My test app does the following:

      opts = { :pool_size => 5, :require_primary => false, :read => :secondary }
      conn = Mongo::ReplSetConnection.new(config[:servers], opts)
      db = conn.db(db_name)
      db.authenticate(user_name, password)

      I get a connection to the secondary but when I try and authenticate I get the following error:

      org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `authenticate_existing' for nil:NilClass
      at ReplSetConnection.authenticate_pools(.../vendor/bundle/jruby/1.9/gems/mongo-1.6.1/lib/mongo/repl_set_connection.rb:290)
      at DB.authenticate(.../vendor/bundle/jruby/1.9/gems/mongo-1.6.1/lib/mongo/db.rb:114)
      ...

      I don't know if this is by design or not. But I would like to be able to authenticate when there is no primary just so my app can keep functioning.

      Thanks,
      Raul

            Assignee:
            tyler@10gen.com Tyler Brock (Inactive)
            Reporter:
            ismell Raul E Rangel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: