Some indexes for collection 'X' could not be created. Index build failed:

Hey,

MongoDB totally newb here. Here’s an error I’m constantly noticing when running an app (Rocket.Chat):

Some indexes for collection 'rocketchat_read_receipts' could not be created:
     Index build failed: 92e953ad-cab0-4a72-9aac-2f7ff42b728c: Collection wow.rocketchat_read_receipts ( 56973a08-1e09-4b39-baf5-3f48627e51ce ) :: caused by :: E11000 duplicate key error collection: wow.rocketchat_read_receipts index: roomId_1_userId_1_messageId_1 dup key: { roomId: "5P57dW2WfpDghDdKw", userId: "EuR8TtKnHMNgKjBni", messageId: "Pj8Qfu5zaoez5Rpmu" }

Also I’m looking to fix this:

wow-rocketchat-1  | MessageType.render is deprecated. Use MessageType.message instead. livechat_webrtc_video_call
wow-rocketchat-1  | {"level":40,"time":"2022-08-16T21:05:25.034Z","pid":1,"hostname":"cd8fa92844a7","name":"VoIPService","msg":"Voip is not enabled. Cant start the service"}
wow-rocketchat-1  | {"level":40,"time":"2022-08-16T21:05:26.511Z","pid":1,"hostname":"cd8fa92844a7","name":"VoIPService","msg":"VoIP service already stopped"}
wow-rocketchat-1  | {"level":51,"time":"2022-08-16T21:05:26.654Z","pid":1,"hostname":"cd8fa92844a7","name":"Migrations","msg":"Not migrating, already at version 279"}

Can you please give me some hints?

Thank you!

Hello @Razvan_Rosca and welcome to the MongoDB community forums. :wave:

The first error is because an index is trying to be created as unique but there are duplicate records for the three fields. You would need to figure out how duplicate entries are getting entered into the database from the application. I’ve not used the app before so not sure what might be going on.

As for the second error, that looks like an error with the app itself and nothing to do with MongoDB.

1 Like