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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.0
    • Affects Version/s: 1.8.5
    • Component/s: Replica Set
    • None
    • Environment:
      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

      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

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

              Created:
              Updated:
              Resolved: