We're running rocketchat and are upgrading daily on an automated basis with allowing even major version upgrades. Today we've received the upgrade to 5.0 and run into two errors.
Obviously we're running rocketchat within containers (actually this system is still running on a docker basis).
Until now we've been running mongodb 4.2. With the current release of rocketchat, the connection strings slightly changed, which is luckily annotated by the devs in the release notes.
You can spot that you're missing the configuration when the rocketchat logs show that the connection to the database has been closed unexpectedly.
The important part is to append the query parameter
directConnection=true to the connection string. The configurations might look like this:
Working on the system is a good starting point to upgrade mongoDB to a current release. Just be aware that you need to upgrade in supported version steps like 4.0 -> 4.2 -> 4.4 -> 5.0.
Another error you may see is that rocketchat fails on altering indices after upgrade.
The solution here is to remove indices from the database and let rocketchat create them.
In my case, I needed to remove the following indices:
Having done this, rocketchat started again without any issue.