# Bad Gateway DigitalOcean

**URL:** <https://forums.rocket.chat/t/bad-gateway-digitalocean/15240>\
**Category:** Community Support\
**Created:** [October 27, 2022, 1:28pm UTC](https://forums.rocket.chat/t/bad-gateway-digitalocean/15240 "2022-10-27T13:28:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acerachat](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@acerachat](https://forums.rocket.chat/u/acerachat)\
**Post date:** [October 27, 2022, 1:28pm UTC](https://forums.rocket.chat/t/bad-gateway-digitalocean/15240/1 "2022-10-27T13:28:47Z")

</div>

### Description

### Server Setup Information

- Version of Rocket.Chat Server: 5.2.0
- Operating System: Ubuntu
- Deployment Method: Manual
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: v14.19.3
- MongoDB Version: 5.0.12
- Proxy:
- Firewalls involved:

### Any additional Information

At seemingly random times, the server stops responding, giving a ‘Bad Gateway’ error. The URL of the server is [acerachat.com](http://acerachat.com). I can fix it by running ‘systemctl restart rocketchat’ manually, but that takes a while. It is deployed with the 1-click DigitalOcean installation. Thanks so much in advance!

Edit: When the error is occuring, ‘systemctl status rocketchat’ returns :

**●** rocketchat.service - The Rocket.Chat server

Loaded: loaded (/lib/systemd/system/rocketchat.service; enabled; vendor pr\>

Active: **failed** (Result: core-dump) since Thu 2022-10-27 14:32:46 UTC; 35s \>

Process: 47311 ExecStart=/opt/nvm/versions/node/v14.19.3/bin/node /opt/Rock\>

Main PID: 47311 (code=dumped, signal=ABRT)

Oct 27 14:32:46 AceraChat rocketchat[47311]: 21: 0xaab719 node::PerIsolatePlatf\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 22: 0x13c0a86 [/opt/nvm/versions/\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 23: 0x13d2ff4 [/opt/nvm/versions/\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 24: 0x13c13d8 uv\_run [/opt/nvm/ver\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 25: 0xa7b642 node::NodeMainInstanc\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 26: 0xa03805 node::Start(int, char\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 27: 0x7ffaf484c083 \_\_libc\_start\_ma\>

Oct 27 14:32:46 AceraChat rocketchat[47311]: 28: 0x98c58c [/opt/nvm/versions/n\>

Oct 27 14:32:46 AceraChat systemd[1]: **rocketchat.service: Main process exited,** \>

Oct 27 14:32:46 AceraChat systemd[1]: **rocketchat.service: Failed with result 'c** \>

---

<div class="post-metadata">

**Author:** ![Geomas](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@Geomas](https://forums.rocket.chat/u/Geomas)\
**Post date:** [November 2, 2022, 1:04pm UTC](https://forums.rocket.chat/t/bad-gateway-digitalocean/15240/2 "2022-11-02T13:04:56Z")

</div>

I had a similar problem and [posted about it](https://open.rocket.chat/channel/support?msg=L8sy8n2mbqT9j7YJW) on Rocket.Chat’s #support channel. Debdut Chakraborty posted a solution that thus far seems to have resolved the issue:

Edit the /lib/systemd/system/rocketchat.service file, add the line `Environment=NODE_OPTIONS=--max_old_space_size=4096` with the other Environment lines. Then run `systemctl daemon-reload` `systemctl restart rocketchat`

Debdut explains that this will increase nodejs’ maximum heap size.  
In my case, I also needed to reboot the system. I hope this helps!
