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

Steps to reproduce the behavior

Brand new heroku instance. Deploy to heroku git push heroku master.

Expected behavior

Application starts and binds to process.env.PORT

Actual behavior

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch. I am debugging process.env and it does have PORT set:

heroku/web.1:  State changed from crashed to starting 
heroku/web.1:  Starting process with command `node keystone.js`
app/web.1:  env ---> { WEB_MEMORY: '512', 
app/web.1:    MEMORY_AVAILABLE: '512', 
app/web.1:    CLOUDINARY_URL: 'cloudinary://...', 
app/web.1:    DYNO: 'web.1', 
app/web.1:    PAPERTRAIL_API_TOKEN: '...', 
app/web.1:    PATH: '/app/.heroku/node/bin:/app/.heroku/yarn/bin:/usr/local/bin:/usr/bin:/bin:/app/bin:/app/node_modules/.bin', 
app/web.1:    WEB_CONCURRENCY: '1', 
app/web.1:    PWD: '/app', 
app/web.1:    MONGOLAB_URI: 'mongodb://...', 
app/web.1:    NODE_ENV: 'production', 
app/web.1:    PS1: '\\[\\033[01;34m\\]\\w\\[\\033[00m\\] \\[\\033[01;32m\\]$ \\[\\033[00m\\]', 
app/web.1:    SHLVL: '1', 
app/web.1:    HOME: '/app', 
app/web.1:    COOKIE_SECRET: '...', 
app/web.1:    PORT: '43760', 
app/web.1:    NODE_HOME: '/app/.heroku/node', 
app/web.1:    _: '/app/.heroku/node/bin/node' } 
heroku/web.1: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 
heroku/web.1:  Stopping process with SIGKILL 
heroku/web.1:  State changed from starting to crashed 
heroku/web.1:  Process exited with status 137 

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 41 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Found the issue! I removed this from my package.json

"engines": {
    "node": ">=0.10.22",
    "npm": ">=1.3.14"
  },

When Heroku uses the default node version, it works perfectly!

I solved the problem by changing the Procfile.

change web to worker

and then, if it do not work**,** on the heroku cli type the following: $ heroku scale web=0 worker=1

Hi folks,

I had this issue and fixed it. It’s a binding error between keystone server and heroku configuration. It means that you’re not listening with heroku on the right port or the right host.

In my case, I had to set the host on 0.0.0.0 and not 127.0.0.1 as recommended on heroku support. Here is the link regarding a r10 error : heroku Error R10 help .

Hope it will save you 3 hours of productivity.

I have this problem too, but in Python web app.

2018-02-28T21:28:48.310949+00:00 heroku[web.1]: - Starting process with command 'python bot.py`
2018-02-28T21:29:48.530267+00:00 heroku[web.1]: - Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-02-28T21:29:48.530693+00:00 heroku[web.1]: - Stopping process with SIGKILL
2018-02-28T21:29:48.642700+00:00 heroku[web.1]: - Process exited with status 137
2018-02-28T21:29:48.715887+00:00 heroku[web.1]: - State changed from starting to crashed
2018-02-28T21:29:48.718579+00:00 heroku[web.1]: - State changed from crashed to starting
2018-02-28T21:29:52.041685+00:00 heroku[web.1]: - Starting process with command `python bot.py`
2018-02-28T21:30:52.547883+00:00 heroku[web.1]: - Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-02-28T21:30:52.547980+00:00 heroku[web.1]: - Stopping process with SIGKILL
2018-02-28T21:30:52.626431+00:00 heroku[web.1]: - Process exited with status 137
2018-02-28T21:30:52.767157+00:00 heroku[web.1]: - State changed from starting to crashed

How to fix this? It’s a telegram bot, it only works for a minute. UPD Yes, I know that this is a js repository, I just did not find any more information about this error. Thank you in advance

The below steps resolved my solution:

Editing package.json as:

… “engines”: { “node”: “5.0.0”, “npm”: “4.6.1” }, …

and Server.js as:

… var port = process.env.PORT || 3000; app.listen(port, “0.0.0.0”, function() { console.log(“Listening on Port 3000”); }); …

Heroku dynamically assigns your app a port, so you can’t set the port to a fixed number which it looks like your doing at PORT: ‘43760’.

Thank @AlanFonderflick This was my code before const PORT = 3000;

and I changed it to const PORT = process.env.PORT || 3000;

Yuhuuuu. it worked. Thanks for saving 3 hours of productivity. 😃

I am still sufferring from the same issue, Web process failed to bind within 60 seconds of launch. I have applied all fixes mentioned above. Please guide me

This happened to me when i write a static hard coded port number. using process.env.PORT || 3000; to be listened solve the exact error.

I’ve pushed a fix that removes engines from the package.json, which will hopefully resolve this for good.

Following lines solved my problem on FastAPI - Python3.9.11 (by altering my Procfile).

web: uvicorn api:app --port $PORT --host 0.0.0.0 

where api.py is my code’s entry point

Im facing the same challenge when trying to deploy with heroku my stripe backend, i tried to remove engine configuration but it still doesnt work…

Screenshot 2021-04-20 at 12 53 25

This is the log from heroku, help please… The repo im trying to deploy is from stripe starter strapi-starter-next-ecommerce

Maybe you need change web: filename.py to app: filename.py if it’s telegram bot

Just has two sites that encountered the same issue after working for months, then having to do a hotfix today, the above error was encountered. Removing the “engines” from the package.json allowed the app to start without error.

I’ve experienced this, too. You can send a support ticket to Heroku asking for more startup time. They will add another 30 seconds for you.

I solved the problem by changing the Procfile.

change web to worker

and then, if it do not work**,** on the heroku cli type the following: $ heroku scale web=0 worker=1 Thanks! It’s helped me, but without web=0: $ heroku scale worker=1

I was trying to deploy a mean stack project on heroku. In my server I am listening to process.env.PORT || 3000; dynamically. My mongodb is also deployed with mlab. Still I am facing the issue Web process failed to bind $port within 60 seconds of launch. and app crashes.

Thank @AlanFonderflick This was my code before const PORT = 3000;

and I changed it to const PORT = process.env.PORT || 3000;

Yuhuuuu. it worked. Thanks for saving 3 hours of productivity. 😃

Thank you, you save my life

When deploying an application that uses webpack to heroku, I got the same error and my solution was:

  • I changed my server.js to include this code
var express = require('express');
var app = express();
var path = require('path');


app.use(express.static(__dirname + '/'));
app.get('*', (req, res) =>{
    res.sendFile(path.resolve(__dirname, './src/index.html'));
});
app.listen(process.env.PORT || 8080);
  • Then added a Procfile with the following code
web: node server.js

This simply tells heroku which port to use and also which command to use when starting the server remotely. Since, you know, when heroku starts the server using npm start, it automatically listens to the default port. Therefore when you specify in Procfile the command to start the server, heroku will use the port you specify.

@sakshi30 Need more details.