RocketChat / RocketChat/Rocket.Chat

4.7.0 Upgrade: "Error creating index: users -> meteor.users index: bio_1 dup key: { bio: null }"

Open
#25,576 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

After upgrading to a version higher than 4.3.3, an error occurs:

Error creating index: users -> { bio: 1 } { unique: 1 } MongoError: E11000 duplicate key error collection: meteor.users index: bio_1 dup key: { bio: null }
    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) {
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 41, high_: 1652353563 },
  ok: 0,
  code: 11000,
  codeName: 'DuplicateKey',
  keyPattern: { bio: 1 },
  keyValue: { bio: null },
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 41, high_: 1652353563 },
    signature: { hash: [Binary], keyId: 0 }
  }
}
Steps to reproduce:
  1. Run rocket.chat docker instance lower than 4.3.3 or equals with 4.3.3. I used 3.18.5, 4.0.4, 4.3.3.
  2. Update to 4.7.0
  3. Run docker logs to track error.
Server Setup Information:
  • Version of Rocket.Chat Server: 4.3.3
  • Operating System: CentOS Linux release 7.9.2009
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • NodeJS Version: v12.22.8
  • MongoDB Version: 4.2.19 / wiredTiger (oplog Enabled)
Additional context

Similar problem marked as resolved in https://github.com/RocketChat/Rocket.Chat/issues/24347
Still occurs for some users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the upgrade from 4.3.3 to 4.7.0 using the Docker setup and inspect creation of the meteor.users bio index. Use the reported MongoDB duplicate-key output and the listed versions to isolate the migration behavior. Done means the upgrade completes without this index-creation error for affected users, with a regression check if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, mongodb, node.js
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.