Description
We have a snap installation of RocketChat which was running nicely over the past years (a few hundred users) and I need to move it to our Docker swarm. The snap installation is 3.18.7 and I started with the described procedure: stopping it, creating a mongodb-backup, launching a Docker with the very same version, stopping the RocketChat service, restoring the database etc. and then went on with the following upgrade path
3.18.7 -> 4.0.0 -> 4.8.6 -> 5.0.0 -> 5.4.3
With this Docker setup:
services:
rocketchat:
<<: *default-opts
image: registry.rocket.chat/rocketchat/rocket.chat:3.18.7
environment:
MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
MONGO_OPLOG_URL: "mongodb://mongodb:27017/local?replicaSet=rs0"
It worked nicely (I thought) but now I realise that all the uploads are missing. They show a “Retry” button and that’s it.
I restarted the process and the uploads are already lost when moving 3.8.17 (snap) to 3.8.17 (Docker).
Btw. the original snap installation used MongoDB 3.6.14 / wiredTiger (oplog Enabled)
and in the new Docker system I have to use MongoDB 4.4.15 / wiredTiger (oplog Enabled)
since I was unable to get v3.6 running.
Is that maybe the problem?
Should I try changing the file upload system to “FileSystem” and then migrate? I only found this “workaround” Question: Howto Migrate the files from Gridfs to Filesystem? · Issue #9349 · RocketChat/Rocket.Chat · GitHub and not sure if it’s recommended.
This is the mongodb Docker service setup:
mongodb:
<<: *default-opts
image: docker.io/bitnami/mongodb:4.4
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: rs0
MONGODB_PORT_NUMBER: 27017
MONGODB_INITIAL_PRIMARY_HOST: mongodb
MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
MONGODB_ADVERTISED_HOSTNAME: mongodb
MONGODB_ENABLE_JOURNAL: "true"
I thought my problem is similar to Migrate self hosted server from 3.18 snap to 5.0 docker based installation but I am using “GridFS” on the old system and have not set it to “Filesystem” yet.
Also all the migrations were reported to be successful during the update process.
I also found another issue regarding a changed URL redirect rule as reported in After update to 3.11.0, embedded images appear with "Retry" - Rocket.Chat - EGroupware Help Forum but I am using the “original” Docker image, so I don’t think it’s related.
All in all, I rolled back the test migration and started another one, so now I only went from 3.18.7 (snap) to 3.18.7 (Docker) and everything is fine but the uploads are missing:
I also don’t see any errors neither in the Browser, nor in the RocketChat logs. Here are the last few lines:
I20230313-12:32:17.619(0) Setting default file store to GridFS
I20230313-12:32:17.701(0) LocalStore: store created at
I20230313-12:32:17.702(0) LocalStore: store created at
I20230313-12:32:17.702(0) LocalStore: store created at
I20230313-12:32:22.564(0) (migrations.js:120) Migrations: Not migrating, already at version 232
I20230313-12:32:22.719(0) ufs: temp directory created at "/tmp/ufs"
I20230313-12:32:25.769(0) Loaded the Apps Framework and loaded a total of 0 Apps!
I20230313-12:32:25.877(0) Using GridFS for custom sounds storage
I20230313-12:32:25.880(0) Using GridFS for custom emoji storage
I20230313-12:32:26.211(0) Updating process.env.MAIL_URL
I20230313-12:32:26.811(0) âž” server.js:204 System âž” startup
I20230313-12:32:26.811(0) âž” +-----------------------------------------------+
I20230313-12:32:26.812(0) âž” | SERVER RUNNING |
I20230313-12:32:26.812(0) âž” +-----------------------------------------------+
I20230313-12:32:26.812(0) âž” | |
I20230313-12:32:26.812(0) âž” | Rocket.Chat Version: 3.18.7 |
I20230313-12:32:26.812(0) âž” | NodeJS Version: 12.22.1 - x64 |
I20230313-12:32:26.812(0) âž” | MongoDB Version: 4.4.15 |
I20230313-12:32:26.813(0) âž” | MongoDB Engine: wiredTiger |
I20230313-12:32:26.813(0) âž” | Platform: linux |
I20230313-12:32:26.813(0) âž” | Process Port: 3000 |
I20230313-12:32:26.813(0) âž” | Site URL: https://chat.ecap.work |
I20230313-12:32:26.813(0) âž” | ReplicaSet OpLog: Enabled |
I20230313-12:32:26.813(0) âž” | Commit Hash: 660c9f5e89 |
I20230313-12:32:26.813(0) âž” | Commit Branch: HEAD |
I20230313-12:32:26.814(0) âž” | |
I20230313-12:32:26.814(0) âž” +-----------------------------------------------+
Server Setup Information
- Version of Rocket.Chat Server: 3.18.7 → 3.18.7
- Operating System: Debian Buster
- Deployment Method: snap → Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: 1
- NodeJS Version: v12.22.1
- MongoDB Version: 3.6.14 wiredTiger (oplog Enabled) → 4.4.15 wiredTiger (oplog Enabled)
- Proxy: apache
- Firewalls involved: yes but unrleaded. HAProxy is front of the service with SSL termination and the following config:
backend be_chat.ECAP
balance roundrobin
cookie SERVERID insert indirect
option httpchk GET /
default-server check maxconn 20
server-template ecap-chat- 1 ecap-chat_rocketchat:3000 check resolvers docker init-addr libc,none