Question

Bad gateway after installing Rocket Chat

Posted January 29, 2020 1.4k views
Applications

Hi,

I’ve followed the instructions to install Rocket Chat: https://marketplace.digitalocean.com/apps/rocket-chat

It worked fine while I was trying to connect directly via the IP.

Then I’ve set up a subdomain and generated an SSL certificate with the command:

rocketchatctl configure –lets-encrypt –root-url=https://chat.yourcompany.com –letsencrypt-email=admin@yourcompany.com

But now it doesn’t work anymore, and the page only displays “Bad Gateway”.

I think I’ve done things correctly with the subdomain: an A record and NTS records sending to DigitalOcean.

I have no idea what could be wrong, I’m new to Rocket Chat and DigitalOcean.

Any help is welcome, thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi @leodavesne,

I’ve tried setting up a new Rocket Chat Droplet from the Marketplace and I ran the rocketchatctl command to issue an SSL certificate for my domain. This all worked as expected.

Have you tried checking the status of your Rocket Chat service to see if it is up and running:

sudo systemctl status rocketchat.service 

If it is not running try to start it:

sudo systemctl start rocketchat.service 

Let me know how it goes!
Regards,
Bobby

Running sudo systemctl status rocketchat.service returns

● rocketchat.service - The Rocket.Chat server                                                                              Loaded: loaded (/lib/systemd/system/rocketchat.service; enabled; vendor preset: enabled)                                Active: failed (Result: exit-code) since Sat 2020-03-14 19:08:49 UTC; 1min 12s ago                                     Process: 1320 ExecStart=/usr/bin/node /opt/Rocket.Chat/main.js (code=exited, status=1/FAILURE)                         Main PID: 1320 (code=exited, status=1/FAILURE)                                                                                                                                                                                                 Mar 14 19:08:49 chat systemd[1]: Started The Rocket.Chat server.                                                        Mar 14 19:08:49 chat rocketchat[1320]: Meteor requires Node v12.0.0 or later.                                           Mar 14 19:08:49 chat systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE                 Mar 14 19:08:49 chat systemd[1]: rocketchat.service: Failed with result 'exit-code'.
  • Same here

    ● rocketchat.service - The Rocket.Chat server
       Loaded: loaded (/lib/systemd/system/rocketchat.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2020-04-22 18:50:10 UTC; 2min 39s ago
      Process: 1275 ExecStart=/usr/bin/node /opt/Rocket.Chat/main.js (code=exited, status=1/FAILURE)
     Main PID: 1275 (code=exited, status=1/FAILURE)
    
    Apr 22 18:50:10 srv4 systemd[1]: Started The Rocket.Chat server.
    Apr 22 18:50:10 srv4 rocketchat[1275]: Meteor requires Node v12.0.0 or later.
    Apr 22 18:50:10 srv4 systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
    Apr 22 18:50:10 srv4 systemd[1]: rocketchat.service: Failed with result 'exit-code'.
    

I solved the issue by reinstalling nginx.

First check if nginx is present;

sudo ufw app list

If it’s not listed then install;

sudo apt update
sudo apt install nginx

This worked for me. I don’t know what brought up the error though.

  • Thank you so much @madebyaban. You saved my day with this.

    • You’re welcome @Thubz

      For a more clearer solution, whenever you restart rocket chat or update rocket chat, nginx immediately ‘takes up’ port 80 therefore traefik does not work properly.
      Whenever you face the issue, first check the status of traefik

      sudo service traefik status
      

      If it’s not running properly, stop nginx with

      sudo service nginx stop
      

      And then restart traefik

      sudo service traefik restart
      

      That should resolve the issue. But might recur whenever rocket chat updates and you can solve it by repeating the process.

Submit an Answer