camicroscope / Caracal

Conslidated Backend, Auth, and Security Services for caMicroscope
GNU General Public License v3.0
15 stars 94 forks source link

uncaught dup key with caracal @ develop #140

Open birm opened 1 year ago

birm commented 1 year ago
ca-back   | MongoError: E11000 duplicate key error collection: camic.configuration index: config_name_1 dup key: { config_name: "additional_links" }
ca-back   |     at MessageStream.messageHandler (/src/node_modules/mongodb/lib/cmap/connection.js:268:20)
ca-back   |     at MessageStream.emit (node:events:394:28)
ca-back   |     at processIncomingData (/src/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
ca-back   |     at MessageStream._write (/src/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
ca-back   |     at writeOrBuffer (node:internal/streams/writable:389:12)
ca-back   |     at _write (node:internal/streams/writable:330:10)
ca-back   |     at MessageStream.Writable.write (node:internal/streams/writable:334:10)
ca-back   |     at Socket.ondata (node:internal/streams/readable:749:22)
ca-back   |     at Socket.emit (node:events:394:28)
ca-back   |     at addChunk (node:internal/streams/readable:312:12) {
ca-back   |   ok: 0,
ca-back   |   code: 11000,
ca-back   |   codeName: 'DuplicateKey',
ca-back   |   keyPattern: { config_name: 1 },
ca-back   |   keyValue: { config_name: 'additional_links' }
ca-back   | }
AbhishekPanta8 commented 1 year ago

This error is occurring because there is already a document in the MongoDB collection with a value of 'additional_links' in the config_name field, and another attempt is being made to insert a document with the same value in the config_name field.

Can you please assign this to me?

birm commented 1 year ago

Submit a PR if you have a fix

AbhishekPanta8 commented 1 year ago

PR should be raised to develop right?