RocketChat / RocketChat/Rocket.Chat

Wrong number of RocketChat Instances in 6.x.x

Open
#31,016 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:

I have self-hosted docker-compose RocketChat behind reverse-proxy which I updated from 5.4.10 > 6.3.7 > 6.4.5
On version 6.x.x my push notifications stopped working and I noticed the message You are operating multiple instances without an active enterprise license - some features may not behave as designed.
In the Instances pop-up, I see two instances, mine and some weird one that has Updated in 2257 (year).
I guess the weird instance is the reason why my push notifications stopped working, but I can't remove it.

I would greatly appreciate help in removing the weird instance and making push notifications back operational.

P.S. During the update I had to reset my previous workspace because the password from the cloud account was lost.
So I created a new cloud account and reset the workplace using the following manual https://handbook.rocket.chat/departments-and-operations/support/support-ticket-faq/how-to-clear-mongodb-to-re-activate-your-workspace

Steps to reproduce:
  1. Go to Administration > Workspace > Workspace tab
  2. Click on the Instances bottom bottom-left
Expected behavior:

The pop-up shows only one instance

Actual behavior:

The pop-up shows 2 instances
image

Server Setup Information:
  • Version of Rocket.Chat Server: 6.4.5
  • Operating System: Ubuntu 22.04
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: oplog Enabled
  • NodeJS Version: v14.21.3
  • MongoDB Version: 6.0.11 / wiredTiger
Client Setup Information
  • Desktop App or Browser Version: Chrome 119.0.6045.159
  • Operating System:- Ubuntu 22.04
Additional context

I get this data from instances.get API when I open Instances pop-up

{
    "instances": [
        {
            "currentStatus": {
                "connected": false
            },
            "instanceRecord": {
                "_id": "HswFZcCA2kHpzGGK2",
                "_createdAt": "2021-07-12T08:46:07.113Z",
                "_updatedAt": "2257-02-26T09:53:32.201Z",
                "extraInformation": {
                    "host": "undefined",
                    "port": "3001",
                    "os": {
                        "type": "Linux",
                        "platform": "linux",
                        "arch": "x64",
                        "release": "4.15.0-34-generic",
                        "uptime": 84,
                        "loadavg": [
                            0.94580078125,
                            0.2568359375,
                            0.0869140625
                        ],
                        "totalmem": 8164683776,
                        "freemem": 5449244672,
                        "cpus": 4
                    },
                    "nodeVersion": "v12.18.4"
                },
                "name": "rocket.chat",
                "pid": 9
            },
            "broadcastAuth": true
        },
        {
            "address": "localhost",
            "currentStatus": {
                "connected": true,
                "lastHeartbeatTime": 11,
                "local": true
            },
            "instanceRecord": {
                "_id": "583dc48a-ec86-4f5f-a82d-bdc4d5b3f42b",
                "_createdAt": "2023-11-20T00:52:18.297Z",
                "_updatedAt": "2023-11-20T01:37:58.390Z",
                "extraInformation": {
                    "host": "localhost",
                    "port": "49500",
                    "tcpPort": 43469,
                    "os": {
                        "type": "Linux",
                        "platform": "linux",
                        "arch": "x64",
                        "release": "5.15.0-78-generic",
                        "uptime": 9214062.4,
                        "loadavg": [
                            0.35,
                            0.18,
                            0.18
                        ],
                        "totalmem": 8123834368,
                        "freemem": 1068396544,
                        "cpus": 4
                    },
                    "nodeVersion": "v14.21.3",
                    "conns": 1
                },
                "name": "rocket.chat",
                "pid": 9
            },
            "broadcastAuth": true
        }
    ],
    "success": true
}

My docker-compose config is the following:

version: '3'

x-rocketchat-port: &port 49500

services:
  rocketchat:
    image: rocketchat/rocket.chat:6.4.5
    command: >
      bash -c
        "for i in `seq 1 30`; do
          node main.js &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    environment:
      PORT: *port
      ROOT_URL: https://chat.act.software/
      MONGO_URL: mongodb://mongo:27017/rocketchat?replicaSet=rs0&directConnection=true
      MONGO_OPLOG_URL: mongodb://mongo:27017/local?replicaSet=rs0&directConnection=true
      VIRTUAL_HOST: my.domain
      VIRTUAL_PORT: *port
      LETSENCRYPT_HOST: my.domain
      LETSENCRYPT_EMAIL: info@my.domain
    depends_on:
      - mongo
    expose:
      - *port
    networks:
      - default
      - acme

  mongo:
    image: mongo:6.0
    restart: unless-stopped
    expose:
      - 27017
    volumes:
     - ./data/db:/data/db
    command: mongod --oplogSize 128 --replSet rs0

  mongo-init-replica:
    image: mongo:6.0
    command: >
      bash -c
        "for i in `seq 1 30`; do
          mongosh mongo/rocketchat --eval \"
            rs.initiate({
              _id: 'rs0',
              members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    depends_on:
      - mongo

  hubot:
    image: rocketchat/hubot-rocketchat:v1.0.11
    restart: unless-stopped
    environment:
      - ROCKETCHAT_URL=rocketchat:49500
      - ROCKETCHAT_ROOM=GENERAL
      - ROCKETCHAT_USER=rocket.cat
      - ROCKETCHAT_PASSWORD=superpassword
      - BOT_NAME=RocketCat
      - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
    depends_on:
      - rocketchat
    volumes:
      - ./scripts:/home/hubot/scripts
    ports:
      - 3002:8080

networks:
  default:
  acme:
    external: true
Relevant logs:

No related logs are present

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 with the Administration > Workspace > Instances view and the instances.get API response described in the report, then trace how instance records and heartbeats are handled. Reproduce the two-instance response with the stale 2257 timestamp and verify that the Instances view shows only the active instance and push notifications operate normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, mongodb, node.js
Domain
api, backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.