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

Cannot connect to auth DB running 2.6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: