Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4252

Auth doesn't work on SyncClusterConnections

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: Security, Shell
    • Labels:
      None
    • ALL

      mongo --nodb
      MongoDB shell version: 2.0.1
      > hosts = 'localhost:10001,localhost:10002,localhost:10003'
      localhost:10001,localhost:10002,localhost:10003

      > conn = new Mongo(hosts)
      Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10001]
      Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10002]
      Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10003]
      connection to localhost:10001,localhost:10002,localhost:10003

      > db = conn.getDB('admin')
      admin
      admin[17:53:34]> db.foo.insert(

      {a:1}

      )
      Thu Nov 10 17:53:39 Error: error doing insert:SyncClusterConnection::insert prepare failed: localhost:10001:

      { assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }

      localhost:10002:

      { assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }

      localhost:10003:

      { assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }

      shell/collection.js:173

      admin[17:53:39]> db.auth('admin','password')
      1

      admin[17:53:47]> db.foo.insert(

      {a:1}

      )
      Thu Nov 10 17:53:50 Error: error doing insert:SyncClusterConnection::insert prepare failed: localhost:10002:

      { assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }

      localhost:10003:

      { assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }

      shell/collection.js:173

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: