RocketChat / RocketChat/Rocket.Chat
read_receipts MongoError: Index build failed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Anyone come across this before/have a fix?
After upgrade (docker) from 4.7.0 -> 4.8.1
| Rocket.Chat Version: 4.8.1 |
| NodeJS Version: 14.18.3 - x64 |
| MongoDB Version: 5.0.9 |
Error creating indexes for read_receipts MongoError: Index build failed: 42a676ef-774f-4ed9-a97a-0791bf2b705a: Collection rocketchat.rocketchat_read_receipts ( f996721f-c895-4221-b308-a1ae10e5e4e0 ) :: caused by :: E11000 duplicate key error collection: rocketchat.rocketchat_read_receipts index: roomId_1_userId_1_messageId_1 dup key: { roomId: "8Msort4RJKCHhgun2M6RSWhdssRGstwMSp", userId: "8Msort4RJKCHhgun2", messageId: "vCvXNfzET7ZXYTv58" }
at MessageStream.messageHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
at MessageStream.emit (events.js:400:28)
at MessageStream.emit (domain.js:475:12)
at processIncomingData (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:731:22)
at Socket.emit (events.js:400:28)
at Socket.emit (domain.js:475:12)
at addChunk (internal/streams/readable.js:293:12)
at readableAddChunk (internal/streams/readable.js:267:9)
at Socket.Readable.push (internal/streams/readable.js:206:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
at TCP.callbackTrampoline (internal/async_hooks.js:130:17) {
ok: 0,
code: 11000,
codeName: 'DuplicateKey',
keyPattern: { roomId: 1, userId: 1, messageId: 1 },
keyValue: {
roomId: '8Msort4RJKCHhgun2M6RSWhdssRGstwMSp',
userId: '8Msort4RJKCHhgun2',
messageId: 'vCvXNfzET7ZXYTv58'
},
'$clusterTime': {
clusterTime: Timestamp { bsontype: 'Timestamp', low: 3, high: 1657757757 },
signature: { hash: [Binary], keyId: 0 }
},
operationTime: Timestamp { bsontype: 'Timestamp', low: 3, high_: 1657757757 }
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining duplicate records in the rocketchat_read_receipts collection and the roomId_1_userId_1_messageId_1 index definition. Determine how the upgrade handles these duplicates and verify that index creation completes successfully without losing required read-receipt data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100