Rocket.Chat's Community Open Call 🎤 Jan 19th, 2022 Join us!

Error on upgrading RocketChat Docker from 4.0.6 to 4.1.x or higher (4.3.1)

Description

I tried to upgrade Docker-Installation from Rocket 4.0.6 (which runs fine) to next 4.1.x oder latest 4.3.1.

Rocket does not start and log shows errors:

Server Setup Information

  • Version of Rocket.Chat Server: 4.0.6
  • Operating System: Synology NAS
  • Deployment Method: Docker →
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version: 4.4.11
  • Proxy: haproxy–>
  • Firewalls involved: no

Any additional Information

LocalStore: store created at 
LocalStore: store created at 
LocalStore: store created at 
[connection] Error: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
Error occurred:  Error [ERR_STREAM_DESTROYED] [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:399:19)
    at clearBuffer (_stream_writable.js:542:7)
    at Socket.Writable.uncork (_stream_writable.js:338:7)
    at JSStreamSocket.doWrite (internal/js_stream_socket.js:176:17)
    at JSStream.onwrite (internal/js_stream_socket.js:33:57)
    at JSStream.callbackTrampoline (internal/async_hooks.js:126:14)
    at Socket.ondata (internal/js_stream_socket.js:77:22)
    at Socket.emit (events.js:314:20)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
    at TCP.callbackTrampoline (internal/async_hooks.js:126:14) {
  code: 'ERR_STREAM_DESTROYED',
  source: 'socket'
}
meteor://💻app/app/app.js:196585
      throw err;
      ^

Error [ERR_STREAM_DESTROYED] [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:399:19)
    at clearBuffer (_stream_writable.js:542:7)
    at Socket.Writable.uncork (_stream_writable.js:338:7)
    at JSStreamSocket.doWrite (internal/js_stream_socket.js:176:17)
    at JSStream.onwrite (internal/js_stream_socket.js:33:57)
    at JSStream.callbackTrampoline (internal/async_hooks.js:126:14)
    at Socket.ondata (internal/js_stream_socket.js:77:22)
    at Socket.emit (events.js:314:20)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
    at TCP.callbackTrampoline (internal/async_hooks.js:126:14) {
  code: 'ERR_STREAM_DESTROYED',
  source: 'socket'
}
Tried 1 times. Waiting 5 secs...
LocalStore: store created at 
LocalStore: store created at 
LocalStore: store created at 
[connection] Error: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
Error occurred:  Error [ERR_STREAM_DESTROYED] [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
meteor://💻app/app/app.js:196585
      throw err;
      ^

Docker-File is this one:

version: '2'

services:
  rocketchat:
    #image: rocketchat/rocket.chat:4.3.1
    image: rocketchat/rocket.chat:4.0.6
    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
    volumes:
      - /volume1/docker/rocketchat/uploads:/app/uploads
      - /volume1/docker/rocketchat/emoji:/app/emoji
      - /volume1/docker/rocketchat/sounds:/app/sounds
    environment:
      - PORT=3000
      - ROOT_URL=http://192.168.217.10:3000
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
#      - MAIL_URL=smtp://smtp.email
#      - HTTP_PROXY=http://proxy.domain.com
#      - HTTPS_PROXY=http://proxy.domain.com
    depends_on:
      - mongo
    ports:
      - 3000:3000
    labels:
      - "traefik.backend=rocketchat"
      - "traefik.frontend.rule=Host: your.domain.tld"

  mongo:
    #image: mongo:4.4.11
    image: mongo:4.4.11
    restart: unless-stopped
    volumes:
     - /volume1/docker/mongodb/db:/data/db
     - /volume1/docker/mongodb/dump:/dump
    command: mongod --oplogSize 128 --replSet rs0
    labels:
      - "traefik.enable=false"

  # this container's job is just run the command to initialize the replica set.
  # it will run the command and remove himself (it will not stay running)
  mongo-init-replica:
    #image: mongo:4.4.11
    image: mongo:4.4.11
    command: >
      bash -c
        "for i in `seq 1 30`; do
          mongo 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, the popular chatbot (add the bot user first and change the password before starting this image)
  #hubot:
  #  image: rocketchat/hubot-rocketchat:latest
  #  restart: unless-stopped
  #  environment:
  #    - ROCKETCHAT_URL=rocketchat:3000
  #    - ROCKETCHAT_ROOM=GENERAL
  #    - ROCKETCHAT_USER=bot
  #    - ROCKETCHAT_PASSWORD=botpassword
  #    - BOT_NAME=bot
  # you can add more scripts as you'd like here, they need to be installable by npm
  #    - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
  #  depends_on:
  #    - rocketchat
  #  labels:
  #    - "traefik.enable=false"
  #  volumes:
  #    - /volume1/docker/rocketchat/hubot/scripts:/home/hubot/scripts
  # this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
  #  ports:
  #    - 3001:8080

  #traefik:
  #  image: traefik:latest
  #  restart: unless-stopped
  #  command: >
  #    traefik
  #     --docker
  #     --acme=true
  #     --acme.domains='your.domain.tld'
  #     --acme.email='your@email.tld'
  #     --acme.entrypoint=https
  #     --acme.storagefile=acme.json
  #     --defaultentrypoints=http
  #     --defaultentrypoints=https
  #     --entryPoints='Name:http Address::80 Redirect.EntryPoint:https'
  #     --entryPoints='Name:https Address::443 TLS.Certificates:'
  #  ports:
  #    - 80:80
  #    - 443:443
  #  volumes:
  #    - /var/run/docker.sock:/var/run/docker.sock