Update Rocket.Chat

Hello,
I try to update my Rocket.Chat 0.74.3 to new version 1.0.1.

rocket01

In the link in this error there is /etc/mongod.conf, I don’t have such file, my file is mongodb.conf so I did

There is problem with mongo, how can I repair this error?

Hi,
did you proceed on your issue?
Looks like you mongoDB was not able to start after your change.
Did you took a look into the log?

you can try:
systemctl start mongodb
systemctl status monodb

To get some hints.
Best regards
Timmi

Without logs, we cannot help you:

journalctl -xe mongodb and paste the output here, wrap them in triple backticks like (```) without parenthesis.

Hello @Timmi ,
result of commands is:

Hi @robbyoconnor
I have an error

rocket04

Hey @zen,

please note that your config file has an error. The problem is the /etc/mongodb.conf file.
Maybe you are able to paste the full error message,
Also the file it self would be great.

Best regards
Timmi

Hi @Timmi
when I want to check status mongo there is such message:

admin1@chat:~$ systemctl status mongodb

● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-04-30 07:41:37 CEST; 3h 26min ago
     Docs: man:mongod(1)
  Process: 6668 ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS (code=exited, status=2)
 Main PID: 6668 (code=exited, status=2)

kwi 30 07:41:37 chat systemd[1]: Started An object/document-oriented database.
kwi 30 07:41:37 chat mongod[6668]: Error parsing INI config file: the options configuration file contains an invalid line 'replication:'
kwi 30 07:41:37 chat mongod[6668]: try '/usr/bin/mongod --help' for more information
kwi 30 07:41:37 chat systemd[1]: mongodb.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
kwi 30 07:41:37 chat systemd[1]: mongodb.service: Failed with result 'exit-code'.
admin1@chat:~$

If you want something more such log file please write where I can find it, I have just installed some time ago Rocket.Chat and it works fine, I am not expert in Linux.

Hi @zen

you need to fix you /etc/mongodb.conf file.
Looks like your version does not like:

kwi 30 07:41:37 chat mongod[6668]: Error parsing INI config file: the options configuration file contains an invalid line 'replication:

The error is preventing the mongodb to start.
Best regards
Timmi

Hi @Timmi,
in my file it looks like this according this link https://rocket.chat/docs/installation/manual-installation/mongo-replicas/

echo -e "replication:\n  replSetName: \"rs01\"" | sudo tee -a /etc/mongod.conf

There is a file /etc/mongod.conf, I don’t have it, so I have changed name in a command for a mongodb.conf

image

Hi @zen,

as I said you need to fix your conf file as the replication is not supported by your MongoDB version.
Please post the complete content of the file.

Best regards
Timmi

Hi @Timmi,
this is my file

# mongodb.conf

# Where to store the data.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 127.0.0.1
#port = 27017

# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true

# Enables periodic logging of CPU utilization and I/O wait
#cpu = true

# Turn on/off security.  Off is currently the default
#noauth = true
#auth = true

# Verbose logging output.
#verbose = true

# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true

# Enable db quota management
#quota = true

# Set diagnostic logging level where n is
#   0=off (default)
#   1=W
#   2=R
#   3=both
#   7=W+some reads
#diaglog = 0

# Diagnostic/debugging option
#nocursors = true

# Ignore query hints
#nohints = true

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true

# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true

# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true

# Disable data file preallocation.
#noprealloc = true

# Specify .ns file size for new databases.
# nssize = <size>

# Accout token for Mongo monitoring server.
#mms-token = <token>

# Server name for Mongo monitoring server.
#mms-name = <server-name>

# Ping interval for Mongo monitoring server.
#mms-interval = <seconds>

# Replication Options

# in replicated mongo databases, specify here whether this is a slave or master
#slave = true
#source = master.example.com
# Slave only: specify a single database to replicate
#only = master.example.com
# or
#master = true
#source = slave.example.com

# Address of a server to pair with.
#pairwith = <server:port>
# Address of arbiter server.
#arbiter = <server:port>
# Automatically resync if slave data is stale
#autoresync
# Custom size for replication operation log.
#oplogSize = <MB>
# Size limit for in-memory storage of op ids.
#opIdMem = <bytes>

# SSL options
# Enable SSL on normal ports
#sslOnNormalPorts = true
# SSL Key file and password
#sslPEMKeyFile = /etc/ssl/mongodb.pem
#sslPEMKeyPassword = pass
replication:
  replSetName: "rs01"

Hi @zen

you need to remove the last two lines of the file.
After that you should be able to start the db again:
systemctl start mongodb

If this is successful you can try to add this to the end of the file:
replSet=rs01
After that restart mongodb
systemctl restart mongodb

If succesfull continue with https://rocket.chat/docs/installation/manual-installation/mongo-replicas/

Best regards
Timmi

Hi @Timmi,
it works, thank you very much for your help and time.

@Timmi I am trying to update rocket chat manually using this documentation. (https://rocket.chat/docs/installation/updating/). but it shows 502 error.

I check my rocket chat status using this command sudo systemctl status rocketchat

the result is

   Loaded: loaded (/etc/systemd/system/rocketchat.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2020-04-09 10:18:25 UTC; 7s ago
  Process: 23898 ExecStart=/usr/local/bin/node /home/ubuntu/Rocket.Chat/main.js (code=exited, status=1/FAILURE)
 Main PID: 23898 (code=exited, status=1/FAILURE)

Apr 09 10:18:25 ip-172-31-16-62 systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
Apr 09 10:18:25 ip-172-31-16-62 systemd[1]: rocketchat.service: Unit entered failed state.
Apr 09 10:18:25 ip-172-31-16-62 systemd[1]: rocketchat.service: Failed with result 'exit-code'.
root@ip-172-31-16-62:/# sudo systemctl start rocketchat
root@ip-172-31-16-62:/# sudo systemctl status rocketchat
● rocketchat.service - RocketChat Server
   Loaded: loaded (/etc/systemd/system/rocketchat.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2020-04-09 10:19:06 UTC; 2s ago
  Process: 23944 ExecStart=/usr/local/bin/node /home/ubuntu/Rocket.Chat/main.js (code=exited, status=1/FAILURE)
 Main PID: 23944 (code=exited, status=1/FAILURE)

Apr 09 10:19:06 ip-172-31-16-62 systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
Apr 09 10:19:06 ip-172-31-16-62 systemd[1]: rocketchat.service: Unit entered failed state.
Apr 09 10:19:06 ip-172-31-16-62 systemd[1]: rocketchat.service: Failed with result 'exit-code'.```

Please suggest how can I resolve this issue.

many thanks.

Hi,

please provide more information what you did and what is your problem.

Best regards
Timmi

Hi Timmi,

Thank you for your response.

My current Rocket chat version 0.69.2, Mongo version 2.6 and Node version 8.12

I want to update all.

I’m using these references:

for node update stable version (https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version)

for mongo update (https://askubuntu.com/questions/958583/how-to-upgrade-mongodb-from-2-6-to-3-4-on-ubuntu-16-04)

for Rocketchat manual update (https://rocket.chat/docs/installation/updating/)

node and mongo updated sucessfully. but when I run commands to update rocketchat. The site shows 502 bad gateway error.

before update mongo and node.

Capture1

after update mongo and node.

after update.

then I reboot server using this command sudo reboot

after reboot. I access my site then it shows 502 bad gateway.

I check the status of mongodb using sudo systemctl status mongodb. and mongodb is active (running)

mongodb.service - LSB: An object/document-oriented database
Loaded: loaded (/etc/init.d/mongodb; bad; vendor preset: enabled)
Active: active (running) since Fri 2020-04-10 14:17:21 UTC; 31min ago
Docs: man:systemd-sysv-generator(8)
Process: 3992 ExecStop=/etc/init.d/mongodb stop (code=exited, status=0/SUCCESS)
Process: 4007 ExecStart=/etc/init.d/mongodb start (code=exited, status=0/SUCCESS)
Tasks: 14
Memory: 32.0M
CPU: 4.511s
CGroup: /system.slice/mongodb.service
└─4020 /usr/bin/mongod --config /etc/mongodb.conf

Apr 10 14:17:20 ip-172-31-3-183 systemd[1]: Stopped LSB: An object/document-oriented database.
Apr 10 14:17:20 ip-172-31-3-183 systemd[1]: Starting LSB: An object/document-oriented database...
Apr 10 14:17:20 ip-172-31-3-183 mongodb[4007]: * Starting database mongodb
Apr 10 14:17:21 ip-172-31-3-183 mongodb[4007]: ...done
Apr 10 14:17:21 ip-172-31-3-183 systemd[1]: Started LSB: An object/document-oriented database.

then I check the status of mongod using sudo systemctl status mongod. and mongod is active (failed)

`root@ip-172-31-3-183:/# systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-04-10 14:17:44 UTC; 41min ago
Docs: https://docs.mongodb.org/manual
Process: 4065 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 4065 (code=exited, status=100)

Apr 10 14:17:44 ip-172-31-3-183 systemd[1]: Stopped MongoDB Database Server.
Apr 10 14:17:44 ip-172-31-3-183 systemd[1]: Started MongoDB Database Server.
Apr 10 14:17:44 ip-172-31-3-183 systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Apr 10 14:17:44 ip-172-31-3-183 systemd[1]: mongod.service: Unit entered failed state.
Apr 10 14:17:44 ip-172-31-3-183 systemd[1]: mongod.service: Failed with result ‘exit-code’.
root@ip-172-31-3-183:/#
`

Hi,

I guess you need to check the mongoDB logs as you can see that the DB is not starting anymore.
Don’t think that I can help much.

Best regards
Timmi

Hey,

This is my mongoDB logs

root@ip-172-31-3-183:/var/log/mongodb# nano mongodb.log
  

GNU nano 2.5.3                                                    File: mongodb.log                                                                                                      Modified

MMM-
M-MMM2020-03-08T06:28:14.373+0000 [clientcursormon] mem (MB) res:67 virt:33160
2020-03-08T06:28:14.373+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:28:14.373+0000 [clientcursormon]  connections:5
2020-03-08T06:30:45.121+0000 [conn13] query rocketchat.rocketchat__trash query: { __collection__: "permissions", _deletedAt: { $gt: new Date(1572505968815) } } planSummary: IXSCAN { _deletedAt: 1 $
2020-03-08T06:31:14.393+0000 [clientcursormon] mem (MB) res:148 virt:33160
2020-03-08T06:31:14.393+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:31:14.393+0000 [clientcursormon]  connections:5
2020-03-08T06:36:14.421+0000 [clientcursormon] mem (MB) res:109 virt:33160
2020-03-08T06:36:14.421+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:36:14.421+0000 [clientcursormon]  connections:5
2020-03-08T06:38:14.433+0000 [clientcursormon] mem (MB) res:151 virt:33160
2020-03-08T06:38:14.433+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:38:14.433+0000 [clientcursormon]  connections:5
2020-03-08T06:43:14.461+0000 [clientcursormon] mem (MB) res:76 virt:33160
2020-03-08T06:43:14.461+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:43:14.461+0000 [clientcursormon]  connections:5
2020-03-08T06:48:14.495+0000 [clientcursormon] mem (MB) res:72 virt:33160
2020-03-08T06:48:14.495+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:48:14.495+0000 [clientcursormon]  connections:5
2020-03-08T06:48:40.974+0000 [conn11] query rocketchat.rocketchat__trash query: { hidden: { $ne: true }, public: true, __collection__: "settings", _deletedAt: { $gt: new Date(1583257678205) } } pl$
2020-03-08T06:48:41.854+0000 [conn11] query rocketchat.rocketchat__trash query: { __collection__: "permissions", _deletedAt: { $gt: new Date(1572505968815) } } planSummary: IXSCAN { _deletedAt: 1 $
2020-03-08T06:49:14.501+0000 [clientcursormon] mem (MB) res:140 virt:33160
2020-03-08T06:49:14.501+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:49:14.501+0000 [clientcursormon]  connections:5
2020-03-08T06:54:14.530+0000 [clientcursormon] mem (MB) res:79 virt:33160
2020-03-08T06:54:14.531+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:54:14.531+0000 [clientcursormon]  connections:5
2020-03-08T06:59:14.560+0000 [clientcursormon] mem (MB) res:141 virt:33160
2020-03-08T06:59:14.560+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T06:59:14.560+0000 [clientcursormon]  connections:5
2020-03-08T06:59:30.253+0000 [conn6] insert rocketchat.rocketchat_message query: { _id: "n2htC8YAaFkbj2iub", rid: "J8SCzModimcCQnQQHsXt9aZG23Mb2MRCWC", msg: "kaam kr rahy ho kia", ts: new Date(158$
2020-03-08T06:59:30.254+0000 [conn6] command rocketchat.$cmd command: insert { insert: "rocketchat_message", documents: [ { _id: "n2htC8YAaFkbj2iub", rid: "J8SCzModimcCQnQQHsXt9aZG23Mb2MRCWC", msg$
2020-03-08T07:04:14.590+0000 [clientcursormon] mem (MB) res:112 virt:33160
2020-03-08T07:04:14.590+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T07:04:14.590+0000 [clientcursormon]  connections:5
2020-03-08T07:09:14.618+0000 [clientcursormon] mem (MB) res:108 virt:33160
2020-03-08T07:09:14.619+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T07:09:14.619+0000 [clientcursormon]  connections:5
2020-03-08T07:12:00.120+0000 [conn12] query rocketchat.rocketchat_oembed_cache query: { updatedAt: { $lte: new Date(1581059520002) } } planSummary: IXSCAN { updatedAt: 1 } cursorid:220448724368 nt$
2020-03-08T07:14:14.648+0000 [clientcursormon] mem (MB) res:84 virt:33160
2020-03-08T07:14:14.648+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T07:14:14.648+0000 [clientcursormon]  connections:5
2020-03-08T07:19:14.677+0000 [clientcursormon] mem (MB) res:81 virt:33160
2020-03-08T07:19:14.677+0000 [clientcursormon]  mapped (incl journal view):32818
2020-03-08T07:19:14.677+0000 [clientcursormon]  connections:5
2020-03-08T07:24:14.706+0000 [clientcursormon] mem (MB) res:81 virt:33160