Cannot upgrade MongoDB 4.4 -> 5.0 in docker

Description

I have Proxmox server with my virtual machines. My CPU is Intel Pentium Gold G6400 - comparison, characteristics and benchmarks which supports AVX.
Ubuntu 20.04.4 is one of my VM where I have installed Rocket.chat as docker. This tutorial was applied to upgrade MongoDB - The Ultimate Guide: Upgrading RocketChat Deployed in Docker and Upgrading MongoDB
Mongo upgrade was made succesfully from 4.0->4.2 and 4.2->4.4 as well.
But when I tried to upgrade from 4.4->5.0 there were some errors.

Server Setup Information

  • Version of Rocket.Chat Server: Version 4.7.2
  • Operating System: Ubuntu server 20.04.4 LTS
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: oplog Enabled)
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.4.14 / wiredTiger
  • Proxy:
  • Firewalls involved: no

Any additional Information

I changed docker-compose.yml for image mongo:5.0 and create new docker. After that I tried to go inside docker

root@nxtc:/opt/rocketchat# docker exec -it rocketchat_mongo_1 bash
Error response from daemon: Container 764b5a5051f1247aeca43241b9d7a704c64c50d7b91f2f68317533776e170a66 is restarting, wait until the container is running

Log from container rocketchat_rocketchat_1

Exception in setInterval callback: MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}

What should I do?
Thank you for your answer.

when I used
docker-compose down
and
docker-compose up -d

my rocketchat_rocketchat_1 has this log

/app/bundle/programs/server/node_modules/fibers/future.js:313
						throw(ex);
						^
MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) {
      'mongo:27017' => ServerDescription {
        address: 'mongo:27017',
        error: Error: getaddrinfo EAI_AGAIN mongo
            at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26) {
          name: 'MongoNetworkError'
        },
        roundTripTime: -1,
        lastUpdateTime: 12192833,
        lastWriteDate: null,
        opTime: null,
        type: 'Unknown',
        topologyVersion: undefined,
        minWireVersion: 0,
        maxWireVersion: 0,
        hosts: [],
        passives: [],
        arbiters: [],
        tags: []
      }
    },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: null
  }
}
Could not start Rocket.Chat. Waiting 5 secs...

It is little bit different.

1 Like

Hi!

This seems to be a MongoDB issue rather than a Rocket.Chat issue.

I believe that not all listed CPUs will be supported, according to this thread on MongoDB forums:

@dudanogueira thank you for your reply.
Does it mean I must put my issue to the MongoDB forum?
Because MongoDB does not recognize that my CPU supports AVX?
Thank you.

Yep. That’s probably it.

But bear in mind that we are only deprecating Mongo 3.6 and 4.0 versions, according to our Mongo Compatibility Matrix and should keep Mongo 4.2+ for the next releases.

@dudanogueira
Thank you for your information. That means a lot to me. I don’t have to hurry anywhere.

Hi @vawaver , did you end up solving this issue? I just recently upgraded RC to 5.0 and I am having the same issue :frowning:

Nope.
My CPU is not compatible with MongoDB 5.0 - MongoDB 5.0 CPU Intel G4650 compatibility - Installation & Upgrades - MongoDB Developer Community Forums

So I stuck.
Another issue is docker upgrade Rocket Chat upgrade 4.8.1 > 5.0.1
I have docker version Rocket 4.8.1 and after docker update to 5.0.1 + MongoDB 4.4… Rocketchat docker cannot start properly.
So I am waiting for some fix.

Hi! Regarding this issue, there is an important note at the 5.0.0 release, have you tried that?

If you’re using MongoDB in a Docker container, you might need to add directConnection=true to MONGO_URL and MONGO_OPLOG_URL environment variables. i.e.: MONGO_URL=mongodb://mongo/rocketchat?replicaSet=rs0&directConnection=true

I am afraid that I do not understand what to do exactly. This is my docker-compose.yaml file that I use for my Rocketchat 4.8.1 + MongoDB 4.4.
Is there any chance to edit this file for Rocketchat 5.0.1 + MongoDB 4.4 to be working?
Thank you for your answer.

Hi! sorry for the late response.

We did a great Rocket.Lab here about this. Maybe it will help you understand this error:

PS: I was not able to check your docker-compose.yml, it never loaded.