com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "connectionId" : 415 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: sbtest.sbtest6.$_id_ dup key: { : 1 }" , "code" : 11000 , "n" : 0 , "ok" : 1.0}

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • run sysbench-mongodb error
    via by 彪 杨,
  • GitHub comment 147#23760487
    via GitHub by btiernay
    ,
  • GitHub comment 73#5239153
    via GitHub by nick0nyx
    ,
  • Inserting records from MySQL into MongoDB via Kettle. Randomly getting Duplicate Key Exceptions which abort the transform. I can successfully add the same records if I do an update instead if insert. This has obvious performance issues. ==========================================ERROR========================================================================== 2013/12/30 15:31:42 - Add Products.0 - ERROR (version 5.0.2, build 1 from 2013-12-04_15-52-25 by buildguy) : Unexpected error 2013/12/30 15:31:42 - Add Products.0 - ERROR (version 5.0.2, build 1 from 2013-12-04_15-52-25 by buildguy) : org.pentaho.di.core.exception.KettleException: 2013/12/30 15:31:42 - Add Products.0 - com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "E11000 duplicate key error index: NAD.products.$_id_ dup key: { : ObjectId('52c1d8122362b762c53d2077') }" , "code" : 11000 , "n" : 0 , "connectionId" : 10 , "ok" : 1.0} 2013/12/30 15:31:42 - Add Products.0 - { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "E11000 duplicate key error index: NAD.products.$_id_ dup key: { : ObjectId('52c1d8122362b762c53d2077') }" , "code" : 11000 , "n" : 0 , "connectionId" : 10 , "ok" : 1.0} 2013/12/30 15:31:42 - Add Products.0 - 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.steps.mongodboutput.MongoDbOutput.doBatch(MongoDbOutput.java:388) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.steps.mongodboutput.MongoDbOutput$1.run(MongoDbOutput.java:265) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.steps.mongodboutput.MongoDbOutput$1.run(MongoDbOutput.java:87) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.mongo.AuthContext.doAs(AuthContext.java:68) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.steps.mongodboutput.MongoDbOutput.processRow(MongoDbOutput.java:87) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) 2013/12/30 15:31:42 - Add Products.0 - at java.lang.Thread.run(Unknown Source) 2013/12/30 15:31:42 - Add Products.0 - Caused by: com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "E11000 duplicate key error index: NAD.products.$_id_ dup key: { : ObjectId('52c1d8122362b762c53d2077') }" , "code" : 11000 , "n" : 0 , "connectionId" : 10 , "ok" : 1.0} 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.CommandResult.getException(CommandResult.java:74) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.CommandResult.throwOnError(CommandResult.java:110) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:102) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:142) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:115) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:248) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBCollection.insert(DBCollection.java:148) 2013/12/30 15:31:42 - Add Products.0 - at com.mongodb.DBCollection.insert(DBCollection.java:133) 2013/12/30 15:31:42 - Add Products.0 - at org.pentaho.di.trans.steps.mongodboutput.MongoDbOutput.doBatch(MongoDbOutput.java:347) 2013/12/30 15:31:42 - Add Products.0 - ... 6 more
    via by Doug Moran,
    • com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "connectionId" : 415 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: sbtest.sbtest6.$_id_ dup key: { : 1 }" , "code" : 11000 , "n" : 0 , "ok" : 1.0} at com.mongodb.CommandResult.getException(CommandResult.java:74) at com.mongodb.CommandResult.throwOnError(CommandResult.java:110) at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:102) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:142) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:115)
    No Bugmate found.