N
N
nurise2016-06-09 19:42:29
Node.js
nurise, 2016-06-09 19:42:29

How to run nodejs-daemon on Heroku?

We need to make the nodejs application work without crashes. Heroku account Hobby. That is, the server itself works 24 hours a day. For some reason, the nodejs process itself crashes after some time. Works locally.
I use foreman and forever packages.
Logs:

2016-06-09T15:41:18.266247+00:00 app[web.1]: warn:    --minUptime not set. Defaulting to: 1000ms
2016-06-09T15:41:18.268493+00:00 app[web.1]: warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
2016-06-09T15:42:15.087242+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-09T15:42:15.087152+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-09T15:42:15.943682+00:00 heroku[web.1]: Process exited with status 137
2016-06-09T15:42:15.958365+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-09T15:54:01.999319+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-09T15:54:03.546443+00:00 heroku[web.1]: Starting process with command `./node_modules/.bin/forever -m 3 index.js`
2016-06-09T15:54:05.558187+00:00 app[web.1]: warn:    --minUptime not set. Defaulting to: 1000ms
2016-06-09T15:54:05.560214+00:00 app[web.1]: warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
2016-06-09T15:55:03.691658+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-09T15:55:03.691658+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-09T15:55:04.469861+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-09T15:55:04.467680+00:00 heroku[web.1]: Process exited with status 137

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
uptech, 2017-11-07
@uptech

Используете ли вы переменную окружения $PORT для подвешвания сервера на него:
https://devcenter.heroku.com/articles/dynos#web-dynos

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question