I’m getting intermittent errors on an app that launched today that I can’t make happen in development. Happens about .05% of the time. Running multiple servers at Modulus with a Compose.io database.
Any ideas? Here’s the error trace from Kadira.
MongoError: insertDocument :: caused by :: 11000 E11000 duplicate key error index: flt-easter.entries.$_id_ dup key: { : "cD9YqcKNGCvwgRipr" }
at Object.Future.wait (/mnt/data/1/node_modules/fibers/future.js:326:15)
at [object Object].<anonymous> (packages/meteor/helpers.js:119:1)
at [object Object].MongoConnection.(anonymous function) (packages/mongo/mongo_driver.js:634:1)
at [object Object].mongoConnectionProto.(anonymous function) [as insert] (packages/meteorhacks:kadira/lib/hijack/db.js:58:1)
at OptimizedApply (packages/meteorhacks:kadira/lib/utils.js:31:1)
at Object.ret.(anonymous function) [as insert] (packages/meteorhacks:kadira/lib/hijack/db.js:16:1)
at [object Object].Mongo.Collection.(anonymous function) (packages/mongo/collection.js:574:1)
at [object Object].Mongo.Collection.(anonymous function) [as insert] (packages/aldeed:collection2/collection2.js:159:1)
at [object Object].Meteor.methods.entryInsert (app/collections/entry.js:60:27)
at [object Object].methodMap.(anonymous function) (packages/meteorhacks:kadira/lib/hijack/wrap_session.js:160:1)
At first, this sounded to me like an intermittent sticky sessions
issue, but your method runs only on the server, which means there is no
id generation on the client. So it cannot be the method being called
twice from the client with the same id.
Meteor’s id’s are theoretically less likely to be unique than those
that are generated natively by mongo, but again that still would be one
in millions, not 0.05%
All your code execute synchronously/blocking so it is not a
synchronicity issue.
Very puzzling, indeed.
I’m sorry I could not help, but sure am interested in what you’ll find
it out to be.