genesis-skeleton icon indicating copy to clipboard operation
genesis-skeleton copied to clipboard

Heroku deploy timeout

Open msaglietto opened this issue 11 years ago • 9 comments

Hello,

I am starting an application on a heroku instance, and im having problems because the bootstrap process timeout by heroku because after a commit its taking more than 60 seconds to bind the port.

Here is the log:

2013-08-02T15:10:55.268775+00:00 app[web.1]: Running "mincss:app" (mincss) task 2013-08-02T15:10:55.717931+00:00 app[web.1]: File build/app/styles/app.min.css created. 2013-08-02T15:11:07.476917+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2013-08-02T15:11:07.477188+00:00 heroku[web.1]: Stopping process with SIGKILL 2013-08-02T15:11:08.933154+00:00 heroku[web.1]: Process exited with status 137 2013-08-02T15:11:08.961825+00:00 heroku[web.1]: State changed from starting to crashed 2013-08-02T15:11:38.319747+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=rs002dev.herokuapp.com fwd="186.59.88.106" dyno= connect= service= status=503 bytes=

If change the procfile to be without the optimize, like web: ./node_modules/.bin/grunt build && node server/server It works fine

Any clues how to make this process faster or the timeout longer?

msaglietto avatar Aug 02 '13 18:08 msaglietto

Can you let me know what's in your bower.json & your index.html (particularly the scripts & css) section?

I mean, not the source, but I just want to see the references to try & reproduce.

Truth be told, the optimization pass can take a while depending on the amount of images & files being parsed...

On Friday, August 2, 2013 at 1:58 PM, Mauricio Saglietto wrote:

Hello,
I am starting an application on a heroku instance, and im having problems because the bootstrap process timeout by heroku because after a commit its taking more than 60 seconds to bind the port. Here is the log:

2013-08-02T15:10:55.268775+00:00 app[web.1 (http://web.1)]: Running "mincss:app" (mincss) task 2013-08-02T15:10:55.717931+00:00 app[web.1 (http://web.1)]: File build/app/styles/app.min.css created. 2013-08-02T15:11:07.476917+00:00 heroku[web.1 (http://web.1)]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2013-08-02T15:11:07.477188+00:00 heroku[web.1 (http://web.1)]: Stopping process with SIGKILL 2013-08-02T15:11:08.933154+00:00 heroku[web.1 (http://web.1)]: Process exited with status 137 2013-08-02T15:11:08.961825+00:00 heroku[web.1 (http://web.1)]: State changed from starting to crashed 2013-08-02T15:11:38.319747+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=rs002dev.herokuapp.com (http://rs002dev.herokuapp.com) fwd="186.59.88.106" dyno= connect= service= status=503 bytes=
If change the procfile to be without the optimize, like
web: ./node_modules/.bin/grunt build && node server/server It works fine
Any clues how to make this process faster or the timeout longer?

— Reply to this email directly or view it on GitHub (https://github.com/ericclemmons/genesis-skeleton/issues/108).

ericclemmons avatar Aug 02 '13 19:08 ericclemmons

to bower.json I only added "angular-resource": "~1.0.7".

And to the index.html I added the navbar on the html and as scripts the angular-resource.js, two angular controllers and a service.

That helps?

msaglietto avatar Aug 02 '13 19:08 msaglietto

It helps :) Basically, you're not doing anything crazy.

Allllright, let's see what I can figure out :)

ericclemmons avatar Aug 02 '13 19:08 ericclemmons

Could it be mongoose that take to much time to be installed from npm?

msaglietto avatar Aug 05 '13 20:08 msaglietto

@ericclemmons did you ever work out a way around this when it's a problem? We are having the same issue with production-level builds (when it minifies, etc). Is there anyway to lower the build time by doing something before-hand locally?

gavinjpotts avatar Oct 22 '13 21:10 gavinjpotts

We're going to need to

  • run foreman start which will simulate the build heroku does.
  • commit the build folder to master 'gasp'
  • change the procfile to just start the app.

facultymatt avatar Oct 22 '13 21:10 facultymatt

Turns out that just having .npmignore (with the build folder removed) seems to work well! Also, I'm moving this to the https://github.com/genesis/ org with several updates!

ericclemmons avatar Oct 23 '13 03:10 ericclemmons

Why is that, aren't you already ignoring node_modules in gitignore? How does .npmignore make the minify process any quicker - this is whats causing the timeout for us - since there's a lot of JS the minify process takes wayyyyy too long. More than the 60 seconds allowed by heroku.

A colleague suggested getting around the by running heroku run bash which gives you command line access to then run build etc. However this means the app won't properly restart on its own which is a big fail.

Also, I've been coming across more and more opinions that bower components and node modules SHOULD be committed for production apps... to avoid failure in cases where the dependencies are not available or removed. THoughts?

facultymatt avatar Oct 23 '13 13:10 facultymatt

.npmignore is treated differently from .gitignore when present and running the command npm pack, which is how Nodejitsu does deployments. Versioning the build folder is totally fine, IMO.

ericclemmons avatar Oct 23 '13 13:10 ericclemmons