Mongo is not available, can't start

Hi all,
not sure if this is right place to ask about this problem, but screenshot shows rocketchat is running but mongo is not available.

I have ubuntu server 16.04 LTS, installed rocket chat snap and worked great untill now.

How can I fix this? I tried remove snap and installed it again, same message.

Thanks.
sudo systemctl status snap.rocketchat-server.rocketchat-server.service
mongo

sudo systemctl status snap.rocketchat-server.rocketchat-mongo.service

● snap.rocketchat-server.rocketchat-mongo.service - Service for snap application rocketchat-server.rocketchat-mongo
Loaded: loaded (/etc/systemd/system/snap.rocketchat-server.rocketchat-mongo.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2018-03-21 18:17:55 CET; 1h 33min ago
Process: 2058 ExecStart=/usr/bin/snap run rocketchat-server.rocketchat-mongo (code=exited, status=48)
Main PID: 2058 (code=exited, status=48)

Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Unit entered failed state.
Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Failed with result ‘exit-code’.
Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Service hold-off time over, scheduling restart.
Mar 21 18:17:55 ubuntu systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-mongo.
Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Start request repeated too quickly.
Mar 21 18:17:55 ubuntu systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-mongo.

sudo journalctl -u snap.rocketchat-server.rocketchat-mongo

I CONTROL [initandlisten] MongoDB starting : pid=2029 port=27017 dbpath=/var/snap/rocketchat-server/common 64
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] db version v3.2.7
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] git version: 4249c1d2b5999ebbf1fdf3bc0e0e3b3ff5c0aaf2
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] allocator: tcmalloc
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] modules: none
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] build environment:
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] distmod: ubuntu1604
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] distarch: x86_64
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] target_arch: x86_64
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.181+0100 I CONTROL [initandlisten] options: { net: { bindIp: “127.0.0.1” }, processManagement: { pidFilePath: "/var/sn
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.200+0100 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 127.0.0.1:27017
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.200+0100 E NETWORK [initandlisten] addr already in use
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.200+0100 E STORAGE [initandlisten] Failed to set up sockets during startup.
Mar 21 18:17:55 ubuntu rocketchat-server.rocketchat-mongo[2000]: 2018-03-21T18:17:55.200+0100 I CONTROL [initandlisten] dbexit: rc: 48
Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Main process exited, code=exited, status=48/n/a
Mar 21 18:17:55 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Unit entered failed state.

ok i solved it with command kill mongod process because it was allready in use, and restarted mongo and rocket.chat, now lets see if i can restore my database data :D.

hi all, problem comes back when i reboot server, so if someone knows what could be the problem please help, if not i will do fresh install of server :frowning:

thanks

oh I removed mongodb-server from server and now port and address is available for rocket chat, is it possible i had two of mongod “fighting” for the address and port? now I can say it works after reboot :smile:

Yes as you discovered if you install mongo and then install the snap… You have issues with mongo starting.

Thanks Aron,

I was confused because i did fresh install of ubuntu server and i choose in the installation menu to install LAMP, SSH…, and i did rocketchat snap install and it was working, then after few days that error came. :grin:

@zoran How to remove mongodb-server? what command did you use ?

You should not install LAMP etc. if you are only going to run Rocket Chat. Choose a minimal Linux installation and only install the depedencies. That will give you a faster and more secure system.

1 Like

Hi. I just googled it. Don’t remember right now the exact command sorry. But, as i see there are still google results in ask ubuntu. Just try to do a google search for something like “ubuntu remove mongodb server”.