0

I am getting an error in my heroku logs that I cannot figure out how to fix.

I read through a thread on stack overflow Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch). This seemed very similar to my problem.

I have developing my app with the express generator. So my bin folder holds the port information

var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);

I know the process.env.PORT is necessary to open my heroku site. I initially assumed this would work well enough as my app.js only had a reference to express.

I could not get the page to open so I added the port information to my app.js file in addition to the bin folder.

app.set('port', (process.env.PORT || 3000));

app.listen(app.get('port'), function() {
  console.log('Node app is running on port', app.get('port'));
});

I got this github page https://github.com/heroku/node-js-getting-started/blob/master/index.js#L16.

However, I am still getting the same error. I do not know where else to look. The only additional note I see with an error is

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

These seem to be targeting the same problem.

Community
  • 1
  • 1
Winnemucca
  • 3,309
  • 11
  • 37
  • 66

1 Answers1

0

What else is your app doing?

Note that the error indicates you didn't bind to the socket within 60 seconds. I agree that your app.set('port', (process.env.PORT || 3000)); looks just fine.

Maybe it's something else - maybe you're making a web callout or something before it even gets to that point, and that's what's consuming the time?

Jon Mountjoy
  • 4,498
  • 22
  • 24