Error upgrading to 4.2.2 (latest stable) from 3.18.3

Description

Server Setup Information

  • Version of Rocket.Chat Server: 4.x/stable
  • Operating System: Ubuntu 20.04.3 LTS
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
  • Proxy: reverse proxied through Caddy
  • Firewalls involved: no

Any additional Information

Tried to upgrade today but got the below error. Anybody know how to fix it?

root@rocketchat:~# snap refresh rocketchat-server
error: cannot perform the following tasks:
- Run post-refresh hook of "rocketchat-server" snap if present (run hook "post-refresh":
-----
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Error reading config file: No such file or directory
try 'mongod --help' for more information
[ERROR] mongo server start failed
[ERROR] post refresh migration "confirm_mongo_startup.sh" run failed
-----)

Hi! Will ask my friend and collegue @debdut.chakraborty to help us on that.

Hang tight :slight_smile:

Hey @arin did I talk to you on open yesterday?

I didn’t, I only just posted this bug report yesterday on this forum. Still haven’t fixed it either. Any idea on how to fix?

Run this

cat <<EOF | sudo tee /var/snap/rocketchat-server/current/mongod.conf 

# For documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# processManagement::fork and systemlog::* are ignored

net:
  bindIp: 127.0.0.1
  port: 27017

setParameter:
  enableLocalhostAuthBypass: false

storage:
  dbPath: /var/snap/rocketchat-server/common
  journal:
    enabled: true

systemLog:
  destination: syslog

replication:
  replSetName: rs0

processManagement:
  pidFilePath:  /var/snap/rocketchat-server/common/mongod.pid

EOF

Then refresh.

2 Likes

That fixed it, thank you for the help.

It does list a banner now saying: “MongoDB version 3.6.23 is deprecated, please upgrade your installation”. Given that this is all a snaps install, I figured it would automatically be upgraded and handled by snaps.

How do I upgrade MongoDB to the latest version that RocketChat supports, using snaps as main install method?

Don’t worry about that. It will be automatically updated with the snap.

2 Likes

Ok, good to know. Thanks again for your help.

I still am getting errors on MongoDB being outdated using snap. When will it be upgraded on the snap channel?

It already has been updated. Which version / revision are you at?

root@rocketchat:~# snap info rocketchat-server
name:      rocketchat-server
summary:   Rocket.Chat server
publisher: Rocket.Chat (rocketchat*)
store-url: https://snapcraft.io/rocketchat-server
contact:   https://open.rocket.chat/channel/ubuntu-snap
license:   unset
description: |
  Have your own Slack like online chat, built with Meteor. https://rocket.chat/
commands:
  - rocketchat-server.backupdb
  - rocketchat-server.mongo
  - rocketchat-server.restoredb
services:
  rocketchat-server.rocketchat-caddy: simple, enabled, inactive
  rocketchat-server.rocketchat-mongo: forking, enabled, active
  rocketchat-server:                  simple, enabled, active
snap-id:      wdBUbiEuMNHmAHLBCXQXOcXaOCvbWS1e
tracking:     4.x/stable
refresh-date: 36 days ago, at 15:19 CST
channels:
  4.x/stable:       4.3.1  2022-01-18 (1509) 238MB -
  4.x/candidate:    4.3.1  2022-01-18 (1509) 238MB -
  4.x/beta:         4.3.1  2022-01-18 (1509) 238MB -
  4.x/edge:         4.3.1  2022-01-18 (1509) 238MB -
  latest/stable:    3.18.3 2021-12-06 (1491) 289MB -
  latest/candidate: 3.18.3 2021-12-06 (1491) 289MB -
  latest/beta:      3.18.3 2021-12-06 (1491) 289MB -
  latest/edge:      4.1.2  2021-12-06 (1497) 285MB -
  3.x/stable:       3.18.3 2021-11-28 (1491) 289MB -
  3.x/candidate:    3.18.3 2021-11-28 (1491) 289MB -
  3.x/beta:         3.18.3 2021-11-28 (1491) 289MB -
  3.x/edge:         3.18.3 2021-11-28 (1491) 289MB -
  2.x/stable:       2.4.14 2020-12-23 (1453) 267MB -
  2.x/candidate:    2.4.14 2020-12-23 (1453) 267MB -
  2.x/beta:         2.4.14 2020-12-23 (1453) 267MB -
  2.x/edge:         ^
installed:          4.2.2             (1502) 255MB -

Tracking the latest. This is what happens when I try to refresh the snap:

root@rocketchat:~# snap refresh
error: cannot perform the following tasks:
- Run pre-refresh hook of "rocketchat-server" snap if present (run hook "pre-refresh":
-----
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
/snap/rocketchat-server/1502/migrations/feature_compatibility/pre_adopt_version.sh: line 6: mongo_version_excluding_patch: command not found
jq: error: Could not open file command: No such file or directory
jq: error: Could not open file argument.: No such file or directory
jq: error: Could not open file Expected: No such file or directory
jq: error: Could not open file '3.6': No such file or directory
jq: error: Could not open file or: No such file or directory
jq: error: Could not open file '3.4',: No such file or directory
jq: error: Could not open file found: No such file or directory
jq: error: Could not open file in:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file setFeatureCompatibilityVersion:: No such file or directory
jq: error: Could not open file \"\",: No such file or directory
jq: error: Could not open file lsid:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file id:: No such file or directory
jq: error: Could not open file UUID(\"804a3c60-8595-4700-b0a9-bc92961e96cc\"): No such file or directory
jq: error: Could not open file },: No such file or directory
jq: error: Could not open file $clusterTime:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file clusterTime:: No such file or directory
jq: error: Could not open file Timestamp(1642808143,: No such file or directory
jq: error: Could not open file 1),: No such file or directory
jq: error: Could not open file signature:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file hash:: No such file or directory
jq: error: Could not open file BinData(0,: No such file or directory
jq: error: Could not open file 0000000000000000000000000000000000000000),: No such file or directory
jq: error: Could not open file keyId:: No such file or directory
jq: error: Could not open file 0: No such file or directory
jq: error: Could not open file }: No such file or directory
jq: error: Could not open file },: No such file or directory
jq: error: Could not open file $db:: No such file or directory
jq: error: Could not open file \"admin\": No such file or directory
jq: error: Could not open file }.: No such file or directory
jq: error: Could not open file See: No such file or directory
jq: error: Could not open file http://dochub.mongodb.org/core/3.6-feature-compatibility.","code":2,"codeName":"BadValue","$clusterTime":{"clusterTime":{"$timestamp":{"t":1642808143,"i":1}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}}}: No such file or directory
jq: error: Could not open file command: No such file or directory
jq: error: Could not open file argument.: No such file or directory
jq: error: Could not open file Expected: No such file or directory
jq: error: Could not open file '3.6': No such file or directory
jq: error: Could not open file or: No such file or directory
jq: error: Could not open file '3.4',: No such file or directory
jq: error: Could not open file found: No such file or directory
jq: error: Could not open file in:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file setFeatureCompatibilityVersion:: No such file or directory
jq: error: Could not open file \"\",: No such file or directory
jq: error: Could not open file lsid:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file id:: No such file or directory
jq: error: Could not open file UUID(\"804a3c60-8595-4700-b0a9-bc92961e96cc\"): No such file or directory
jq: error: Could not open file },: No such file or directory
jq: error: Could not open file $clusterTime:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file clusterTime:: No such file or directory
jq: error: Could not open file Timestamp(1642808143,: No such file or directory
jq: error: Could not open file 1),: No such file or directory
jq: error: Could not open file signature:: No such file or directory
jq: error: Could not open file {: No such file or directory
jq: error: Could not open file hash:: No such file or directory
jq: error: Could not open file BinData(0,: No such file or directory
jq: error: Could not open file 0000000000000000000000000000000000000000),: No such file or directory
jq: error: Could not open file keyId:: No such file or directory
jq: error: Could not open file 0: No such file or directory
jq: error: Could not open file }: No such file or directory
jq: error: Could not open file },: No such file or directory
jq: error: Could not open file $db:: No such file or directory
jq: error: Could not open file \"admin\": No such file or directory
jq: error: Could not open file }.: No such file or directory
jq: error: Could not open file See: No such file or directory
jq: error: Could not open file http://dochub.mongodb.org/core/3.6-feature-compatibility.","code":2,"codeName":"BadValue","$clusterTime":{"clusterTime":{"$timestamp":{"t":1642808143,"i":1}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}}}: No such file or directory
[ERROR] JSON.stringify(db.adminCommand({ setFeatureCompatibilityVersion: "" })) command failed
[ERROR] pre refresh migration "adopt_version.sh" run failed
-----)
root@rocketchat:~#

On certain hosts this error is surfacing. Similar in nature to the main post of this thread.

Run the following to upgrade

snap set rocketchat-server ignore-errors=true
snap refresh rocketchat-server
1 Like

The snap refresh went through, but now my Caddy reverse proxy doesn’t work anymore with RocketChat. It gives me this error on the webpage: Client sent an HTTP request to an HTTPS server. All my other services behind Caddy work just fine, so it has to be related to RocketChat.

It has always worked fine before this. My caddyfile (on another VM) is the following:

(SecurityHeaders) {
        header {
                Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
                X-Xss-Protection "1; mode=block"
                X-Content-Type-Options "nosniff"
                X-Frame-Options "SAMEORIGIN"
                Content-Security-Policy "upgrade-insecure-requests"
                Referrer-Policy "strict-origin-when-cross-origin"
                Cache-Control "public, max-age=15, must-revalidate"
                Permissions-Policy "accelerometer=(none); ambient-light-sensor=(none); autoplay=(self); camera=(none); encrypted-media=(none); fullscreen=(self); geolocation=(none); gyroscope=(none); magnetometer=(none); microphone=(none); midi=(none); payment=(none); picture-in-picture *; speaker=(none); sync-xhr=(none); usb=(none); vr=(none)"

        }
}

my.rocketchat.url {
        import SecurityHeaders
        file_server
        reverse_proxy 192.168.1.63:3000
        tls {
                
                dns cloudflare token_here
                protocols tls1.3
        }
}

How can I get it working again?

@debdut.chakraborty any ideas? I don’t want caddy running on this host as I have another caddy VM elsewhere that currently works - any command I can run with snap to de-activate the rocketchat caddy?

I solved the caddy issue with snap stop --disable rocketchat-server.rocketchat-caddy. Now it works again!

1 Like