[JAVA-1794] DBCollection.addUser fails for pre-2.6 sharded installations Created: 04/May/15  Updated: 05/May/15  Resolved: 04/May/15

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: 3.0.0
Fix Version/s: 3.0.1, 3.1.0

Type: Bug Priority: Minor - P4
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB server version < 2.6
Sharded cluster with three config servers


Issue Links:
Related
related to CSHARP-1266 AddUser fails for pre-2.6 sharded sys... Closed

 Description   

A pre-2.6 sharded clusters with three config servers reports an error when inserting a document into the system.users collection which is not pre-populated with an _id. The 3.0 Java driver does not add an _id, so DBCollection.addUser fails with this exception:

com.mongodb.WriteConcernException: 
Write failed with error code 16460 
and error message 'error inserting 1 documents to shard 
config:127.0.0.1:27016,127.0.0.1:27021,127.0.0.1:27022 
at version 0|0||000000000000000000000000 :: 
caused by ::
SyncClusterConnection::insert obj has to have an _id: { "user" : "rw-admin", "pwd" : "ed61f433385edeee5c2ac9015d231d8e", "readOnly" : false }'



 Comments   
Comment by Jeffrey Yemin [ 05/May/15 ]

Closed for 3.0.1 release.

Comment by Githook User [ 04/May/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: To work around an issue with three-config server sharded clusters, added _id to documents inserted into system.users collection on pre-2.6 MongoDB servers.

JAVA-1794
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/ac440797b38b3346d88747f2f8a546948d4f72c8

Comment by Githook User [ 04/May/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: To work around an issue with three-config server sharded clusters, added _id to documents inserted into system.users collection on pre-2.6 MongoDB servers.

JAVA-1794
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/8eb7fabbc6c8856c66e1dbea29c1c7e10bc0776c

Generated at Thu Feb 08 08:55:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.