[SERVER-4252] Auth doesn't work on SyncClusterConnections Created: 10/Nov/11  Updated: 11/Jul/16  Resolved: 14/Nov/11

Status: Closed
Project: Core Server
Component/s: Security, Shell
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-4237 Enable the full js test suite to run ... Closed
Operating System: ALL
Participants:

 Description   

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



 Comments   
Comment by Kristina Chodorow (Inactive) [ 14/Nov/11 ]

sync[14].js are now passing. sync[36].js have issues that are unrelated to this case, filed SERVER-4280 for that.

Comment by Kristina Chodorow (Inactive) [ 14/Nov/11 ]

Got it. This is similar to SERVER-4241, auth() needs to be moved into C++.

Comment by Spencer Brody (Inactive) [ 14/Nov/11 ]

I just reproduced with both 2.0.1 and HEAD. Try running jstests/sharding/sync*.js - a bunch of those (1,3,4,and 6) are failing for me b/c of this.

Generated at Thu Feb 08 03:05:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.