As you might know, I’ve set up a RocketChat server recently on Digital Ocean. So far it’s been working great. An update every once and a while is all it needs.
However, yesterday, I attempted an update that failed. From then on every attempted update resulted in “RocketChat server not running. Cancelling”. This was very frutrating.
First, a few commands to try that might help:
systemctl restart rocketchat.service
– This will start your RocketChat server in case it is stopped.systemctl status rocketchat.service
– Use this command to check the results of the previous command. Typically this will report that the service is “Active” if the previous command was successful.
In my case, the second command resulted in a “failed” state. The command itself gave me some information as to what the failure was, but not a lot of context as to what caused the failure. However, it did show me the process that it attempted to run. It said, ExecStart=/opt/nvm/versions/node/v14.19.3/bin/node /opt/Rocket.Chat/main.js (code=exited, status=1/FAILURE)
.
Alright! We’re getting somewhere. With that I was able to figure out what command failed and where that command was run. I navigated directly to the /opt/Rocket.Chat
directory which was where the failure was occurring. From here I ran node main.js
. The results of this command were much more helpful. They told me this, Error: Cannot find module '@meteorjs/reify/lib/runtime'
. That looks like an issue with npm dependencies.
So, I poked around the Rocket.Chat directory structure and looked for dependencies for the Rocket.Chat server. I found what I was looking for in the /opt/Rocket.Chat/programs/server
directory.
From this directory I ran two commands
npm install
npm ci
Afterwards I attempted to start the RocketChat server again using the systemctl restart rocketchat.service
command. I checked it with systemctl status rocketchat.service
and found that it was working now! RocketChat was back to running normally. The problem with “RocketChat server not running. Cancelling” was gone!