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

Cannot connect to auth DB running 2.6

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 2.1.1
    • Component/s: None
    • None

      Hello,

      I am having trouble connecting to a remote server with simple authentication. It was working with moped and now that I've switched to mongodb driver it does not work. Here is what I do :

      #ruby
      client = Mongo::Client.new([ 'somehost:someport' ], :database => 'some_db', username: "some_user", password: "some_password")
      client.collections

      #returns
      Mongo::Error::OperationFailure: not authorized for query on some_db.system.namespaces (13)

      Whereas when I do the equivalent using mongodb shell :

      #shell
      mongo somehost:someport

      use some_db
      db.auth("some_user", "some_password")
      db.system.namespaces.find() #equivalent to `show collections`

      #results
      list of collections

      The remote server runs MongoDB 2.6.11

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            rpechayr Romain Pechayre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: