camelCase
camelCase

Reputation: 323

Heroku Boot Timeout (Error R10)

Every time I launch my app it cannot get past the 60 second point without:

2012-05-06T22:41:11+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-05-06T22:41:11+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2012-05-06T22:41:11+00:00 heroku[web.1]: Process exited with status 137
2012-05-06T22:41:12+00:00 heroku[web.1]: State changed from starting to crashed

Here is my Procfile:

web: bundle exec thin start -p $PORT

Any responses will be thoroughly appreciated.

Upvotes: 22

Views: 36459

Answers (9)

viewskiyui
viewskiyui

Reputation: 21

have the same issue, solved by creating file with proxy server https://www.npmjs.com/package/http-proxy#setup-a-basic-stand-alone-proxy-server

proxy.js:

httpProxy.createProxyServer({
    target, // target that can't cant be exposed, e.g. localhost:4000
    changeOrigin: true,
}).listen(process.env.PORT); // port from heroku runtime

then

node server/proxy.js

Upvotes: 0

Oleksii Hyrba
Oleksii Hyrba

Reputation: 1

I got this error because Heroku didn't have access to the Mongo Atlas database. You need to change this in the database settings

Upvotes: 0

Jonathan Vera
Jonathan Vera

Reputation: 1

Error R10 (Boot timeout) is this hidden section of heroku allows you to increase the deployment time.

https://tools.heroku.support/limits/boot_timeout

Upvotes: 0

Suresh Mangs
Suresh Mangs

Reputation: 725

I was having the same error when deploying my Node app on Heroku.

I got it solved by adding a Procfile.

web: node app.js

It tells Heroku how to start the application.

The error is because of Heroku is not able to configure on which PORT to run the application.

It can be solved by specifying the PORT for Heroku, ie: in app.js

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
    console.log(`App is running on port ${ PORT }`);
});

Upvotes: 0

Lucas Fcz
Lucas Fcz

Reputation: 1

In my case using nodejs I solved this adding a Procfile file with content: worker: node index.js and push it to heroku. After that make sure to disable the check "web npm start" and turn on the check "worker node index.js" just like the image attached below

herokuResourcesConfig

Upvotes: 0

sunil kumar
sunil kumar

Reputation: 41

Hi i was facing the same issue.I have resolved this issue by increase the timeout in /config/unicorn.rb change timeout 15 to timeout 20 in /config/unicorn.rb

Upvotes: 1

saintsjd
saintsjd

Reputation: 339

The solution was that I had forgotten to include the -p $PORT in my Procfile line.

in Procfile change:

web: bundle exec thin start

to

web: bundle exec thin start -p $PORT

That fixed it for me.

Upvotes: 11

Peter H. Boling
Peter H. Boling

Reputation: 584

Heroku's boot timeout bit me too. I read several blog posts about how to get around it and ended up automating some of the solutions into a gem.

To reduce the startup time on deploy, you can trim the gems loaded at boot time (this doesn't mean you have to trim them from the app, just boot time).

gem_bench evaluates which gems are likely to not be needed at boot time.

I have an app with about 250 gems and was able to add :require => false to about 60 of them, with dramatic effects.

https://github.com/acquaintable/gem_bench

Disclaimer: I am the author of this open source ruby gem. I wrote the gem to aid myself in solving this exact problem: the 60 second timeout on Heroku.

Upvotes: 3

dB.
dB.

Reputation: 4770

If your app does take longer than 60 seconds for "good" reasons, you can work around the 60s boot time limit with https://github.com/dblock/heroku-forward.

Upvotes: 15

Related Questions