Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1794

DBCollection.addUser fails for pre-2.6 sharded installations

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.0.1, 3.1.0
    • Affects Version/s: 3.0.0
    • Component/s: Command Operations
    • None
    • Environment:
      MongoDB server version < 2.6
      Sharded cluster with three config servers

      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 }'
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: