E11000 duplicate key error collection: tribeca.qp-sub ...
Standard Tribeca docker installation with linked Mongo container.
Sometimes, after clicking "Save" button, you can see this type of error in the log:
{
"name":"tribeca:exchangebroker:repopersister",
"hostname":"d3b31f5af6ba",
"pid":50,
"level":50,
"err":{
"message":"E11000 duplicate key error collection: tribeca_okcoin_btc_usd.qp-sub index: _id_ dup key: { : \"57187fdead6caf32000383f1\" }",
"name":"MongoError",
"stack":"MongoError: E11000 duplicate key error collection: tribeca_okcoin_btc_usd.qp-sub index: _id_ dup key: { : \"57187fdead6caf32000383f1\" }\n at Function.MongoError.create (/tribeca/node_modules/mongodb-core/lib/error.js:31:11)\n at toError (/tribeca/node_modules/mongodb/lib/utils.js:114:22)\n at /tribeca/node_modules/mongodb/lib/collection.js:701:67\n at commandCallback (/tribeca/node_modules/mongodb-core/lib/topologies/server.js:1143:9)\n at Callbacks.emit (/tribeca/node_modules/mongodb-core/lib/topologies/server.js:116:3)\n at null.messageHandler (/tribeca/node_modules/mongodb-core/lib/topologies/server.js:291:23)\n at Socket.<anonymous> (/tribeca/node_modules/mongodb-core/lib/connection/connection.js:285:22)\n at emitOne (events.js:90:13)\n at Socket.emit (events.js:182:7)\n at readableAddChunk (_stream_readable.js:153:18)",
"code":11000
},
"msg":"Unable to insert qp-sub { width: 0.1,\n size: 0.05,\n mode: 0,\n fvModel: 0,\n targetBasePosition: 0.21,\n positionDivergence: 0.8,\n ewmaProtection: false,\n autoPositionMode: 1,\n aggressivePositionRebalancing: false,\n tradesPerMinute: 2.5,\n tradeRateSeconds: 300,\n longEwma: 0.095,\n shortEwma: 0.19,\n quotingEwma: 0.095,\n aprMultiplier: 3,\n stepOverSize: 0.1,\n exchange: 2,\n pair: { base: 1, quote: 0 },\n _id: '57187fdead6caf32000383f1' }",
"time":"2016-04-21T08:06:41.840Z",
"v":0
}
Then, this error appears in log after every click on a "Save" button with same mongo object id.
Restart of Tribeca helps.
Thank you very much for bringing this issue to my attention. I'm looking at this error this afternoon. I'm able to reproduce it, hope to have a fix for it shortly.
I've noticed it's more likely to occur after changing several settings at once, if that helps.
Please do fix :) Nice software but hasn't been updated or fixed in a while @michaelgrosner .
Thank you for sharing this great software!
Is there a workaround? Older mongodb version perhaps?