Rocket.chat: Rocket.chat startup exceeds Heroku Boot Timeout

Created on 24 Mar 2018  Â·  6Comments  Â·  Source: RocketChat/Rocket.Chat

Description:

I update from 0.60.4 to 0.62.2 and I started to have
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
in heroku when heroku restart the dyno (every 24h). I am running RC in a stardard dyno.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.62.2
  • Operating System:
  • Deployment Method(snap/docker/tar/etc): heroku
  • MongoDB: mLab MongoDB Shared Cluster 1GB

Steps to Reproduce:

  1. Run on heroku wth stardard dyno and mLab MongoDB Shared Cluster 1GB

Expected behavior:

Should not have such long time to boot

Actual behavior:

Crush on restart

Relevant logs:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

heroku

All 6 comments

Mhhh... but your server comes up? Or is there any bug that you think might be responsible for that behaviour?

Otherwise I would deem this issue too broad as "starting the server faster" is not just one thing that can be tackled... I suggest that you raise your timeout if possible.

Cheers
Thomas

It comes up eventually, by chance after 10-12 reboot.. But Heroku restart the app once a day facing the issue and make the app unavailable.
It is not possible to raise the timeout, Heroku do not allow it.
As result the deploy on heroku via button is not currently working and Rocket Chat cannot be deployed on Heroku. So I would suggest to remove the deployment on Heroku option if fixing this in not in your priority.
I had to roll back on 0.60.4 version.

I see your point... yet I think it's just not possible within one bug to "make the server start faster" ... yes, Rocket.Chat takes its time to come up... but I don't see anything that could be done fast to solve this. My server usually comes up far faster than 60 seconds, thought it's also not in the order of 5 seconds. You're writing, that you're on a shared mongodb cluster. This might also have a major speed impact. I'm not very familiar with heroku, but can you upgrade your tier maybe?

/cc also to @geekgonecrazy: I think I'd like to close this issue as it's not really sometjing that could be acted upon in a specific manner. What's your take?

Cheers
Thomas

Depending on the amount of channels, users and subscriptions (users in channels) it can take a bit to start. Let's take for instance open.rocket.chat. it can take up to 5 minutes ;)

This is very dependant on server size, mongo and server speed. If it takes even longer because of slow mongo to populate the cache then also nothing we can really do.

I'd agree issue wise. Nothing here to really act on. If we can narrow down and open a specific issue then we can act

Agree with @AntMarras. We have the same issue w RocketChat on Heroku. We did get Heroku to provide us 180s boot time for this app but still we see error messages on the restart every day. Root cause of long boot time seems that Meteor is rebuild each time from the Heroku buildpack. Seems that could be avoided by having binaries in the buildpack for the Heroku environment (Ubuntu)

Heroku support increased my timeout to 120 seconds but that didn't help with this issue for Rocketchat 1.2.1.

One of the solutions that worked on free tier of Heroku

$ git clone https://github.com/RocketChat/Rocket.Chat
Cloning into 'Rocket.Chat'...
remote: Enumerating objects: 200, done.
remote: Counting objects: 100% (200/200), done.
remote: Compressing objects: 100% (173/173), done.
remote: Total 181245 (delta 77), reused 138 (delta 24), pack-reused 181045
Receiving objects: 100% (181245/181245), 123.67 MiB | 4.07 MiB/s, done.
Resolving deltas: 100% (120437/120437), done.

$ cd Rocket.Chat/

$ git checkout tags/0.60.0 -b old-branch
Switched to a new branch 'old-branch'

$ git branch
  develop
* old-branch

$ heroku apps:create  --addons mongolab:sandbox,logentries:le_tryit -b https://github.com/RocketChat/heroku-buildpack-meteor rocketchatheroku
Creating ⬢ rocketchatheroku... done
Adding mongolab:sandbox... done
Adding logentries:le_tryit... done
Setting buildpack to https://github.com/RocketChat/heroku-buildpack-meteor... done
https://rocketchatheroku.herokuapp.com/ | https://git.heroku.com/rocketchatheroku.git

$ heroku config:add ROOT_URL=https://rocketchatheroku.herokuapp.com/
Setting ROOT_URL and restarting ⬢ rocketchatheroku... done, v5
ROOT_URL: https://rocketchatheroku.herokuapp.com/

$ git remote add heroku https://git.heroku.com/rocketchatheroku.git

$ git remote -v
heroku  https://git.heroku.com/rocketchatheroku.git (fetch)
heroku  https://git.heroku.com/rocketchatheroku.git (push)
origin  https://github.com/RocketChat/Rocket.Chat (fetch)
origin  https://github.com/RocketChat/Rocket.Chat (push)

$ git config remote.heroku.push +HEAD:refs/heads/master

$ git push heroku +HEAD:master
Counting objects: 111977, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (32814/32814), done.
Writing objects: 100% (111977/111977), 54.47 MiB | 3.07 MiB/s, done.
Total 111977 (delta 76530), reused 111977 (delta 76530)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: -----> Listing HEROKU_ environment variables
remote: HEROKU_APP_ID:
remote: HEROKU_APP_NAME:
...
...
remote: -----> Adding MONGODB_URI -> MONGO_URL env
remote: -----> Adding profile script to resolve MONGO_URL from mongolab addon
remote: -----> Adding profile script to resolve ROOT_URL from heroku app name
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 317M
remote: -----> Launching...
remote:  !     Warning: Your slug size (316 MB) exceeds our soft limit (300 MB) which may affect boot time.
remote:        Released v6
remote:        https://rocketchatheroku.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/rocketchatheroku.git
 * [new branch]          HEAD -> master

The application was available at https://rocketchatheroku.herokuapp.com/.

Credits and references

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Buzzele picture Buzzele  Â·  3Comments

mddvul22 picture mddvul22  Â·  3Comments

amayer5125 picture amayer5125  Â·  3Comments

marceloschmidt picture marceloschmidt  Â·  3Comments

djeber picture djeber  Â·  3Comments