RocketChat / RocketChat/Rocket.Chat

Upgrade from 6.13.1 to 7.0.9 Fails

Open
#35,708 3 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:

I'm preparing for our migration from RocketChat 6.13.1 to 7.x. This is problematic since the current machine does not support the AVX instruction set which is required for MongoDB 5.x+. I have a new host for it now and I have a recent (last week) copy of the MongoDB database so I can do a dry run of the migration. That part of the process has been going okay until now.

  1. I upgraded MongoDB from 4.4 to 7.0.18 (not in one jump obviously)
  2. RocketChat 6.13.1 works fine.
  3. MongoDB 7 is set to use the 7.0 Feature Set and works properly. Oplog is enabled.

When I make a new RocketChat 7 container (7.0.9) and start it, I get the following error which is so vague it's useless to me.

MongoTopologyClosedError: Topology is closed
    at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/src/sdam/topology.ts:515:42
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [Symbol(errorLabels)]: Set(0) {}
}
MongoServerSelectionError: getaddrinfo EAI_AGAIN mongodb
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/src/sdam/topology.ts:591:30)
    at listOnTimeout (node:internal/timers:581:17)
    at processTimers (node:internal/timers:519:7) {
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) { 'mongodb:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    maxElectionId: new ObjectId("7fffffff0000000000000008"),
    maxSetVersion: 2,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}

packages/core-runtime.js:189
            throw error;
errorClass [Error]: [An error occurred when creating an index for collection "users: Topology is closed]
    at Collection.createIndexAsync (packages/mongo/collection.js:1140:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at module.wrapAsync.self (packages/accounts-password/password_server.js:1107:1) {
  isClientSafe: true,
  error: 'An error occurred when creating an index for collection "users: Topology is closed',
  reason: undefined,
  details: undefined,
  errorType: 'Meteor.Error'
}
Steps to reproduce:
  1. Update MongoDB to 7.0.18
  2. Attempt to update RocketChat from 6.13.1 to 7.0.9
Expected behavior:

I expected it to work.

Actual behavior:

Already covered

Server Setup Information:
  • Version of Rocket.Chat Server: 6.13.1
  • License Type: Community
  • Number of Users: 5
  • Operating System: Debian (Synology DSM 7.2.2)
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 20.17.0
  • MongoDB Version: 7.0.18

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

Start by reproducing the Docker upgrade with MongoDB 7.0.18 and reviewing the reported stack traces in packages/mongo/collection.js and packages/accounts-password/password_server.js. Compare the MongoDB connection and replica-set behavior between Rocket.Chat 6.13.1 and 7.0.9; done means identifying the cause of the closed topology and confirming that the upgraded server starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, mongodb, node.js
Domain
backend, databases, devops
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.