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

Unauthorized db error when using Mongo::MongoClient.from_uri when connecting to a replica set

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.8.5
    • 1.9.0
    • Replica Set
    • None
    • ruby mongo v1.8.5, mongod v2.2.4, ruby 2.0.0, client running on Mac OSX 10.8.3, mongod presumably some Linux in ec2

    Description

      Hello I'm currently having problems connecting to a managed replica set hosted on Mongolab. Executing (for example) a count query on a Mongo::DB instance obtained via:
      Mongo::MongoClient.from_uri(ENV['MONGOLAB_URI']).db['collection_name'] I get the following unauthorized message:

      Mongo::OperationFailure: Database command 'count' failed: (assertion: 'unauthorized db:xxx ns:xxx.collection lock type:0 client:xxx'; assertionCode: '10057'; errmsg: 'db assertion failure'; ok: '0.0').

      This also occurs when I attempt to connect to (and query) Mongolab's test replication nodes here: http://mongolab.org/flip-flop/
      ...using the MONGODB_URI mongodb://testdbuser:testdbpass@flip.mongolab.com:53117,flop.mongolab.com:54117/testdb

      Also Mongoid is able to read and write to the replica set above as well.

      Am I missing something fairly obvious here?

      Thank you, Whitney

      Attachments

        Issue Links

          Activity

            People

              brandon.black@10gen.com Brandon Black
              whitneyrzoller Whitney Zoller
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: