Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web process failed to bind to $PORT within 60 seconds of launch #119

Closed
rmnblm opened this issue Sep 20, 2016 · 8 comments
Closed

Web process failed to bind to $PORT within 60 seconds of launch #119

rmnblm opened this issue Sep 20, 2016 · 8 comments

Comments

@rmnblm
Copy link

rmnblm commented Sep 20, 2016

When I deploy a Telegram bot built with this module to Heroku, after 60 seconds I get following error:

2016-09-20T11:50:11.599886+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-09-20T11:50:11.599886+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-09-20T11:50:11.705966+00:00 heroku[web.1]: Process exited with status 137

I couldn't find a way to set a port because there is no .listen(...) method when calling the Telegram constructor. Any ideas?

@rmnblm
Copy link
Author

rmnblm commented Sep 20, 2016

Might be resolved with PR #98

@rmnblm
Copy link
Author

rmnblm commented Sep 20, 2016

I solved the problem by using a Procfile with the following content:

worker: node index.js

I did also run the following command

$ heroku scale web=0 worker=1

@vincentaudebert
Copy link

Watch out. This doesn't work on a free dyno.

@MetaNaveen
Copy link

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");
});
...

@johnKHill
Copy link

Thank you. This worked for me 100%.

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

@rajanbhadauria
Copy link

var express = require('express');
var path = require('path');
var app = express();

global.appRoot = path.resolve(__dirname);

var port = process.env.PORT | 8000;

app.use(express.static(appRoot + '/public/dist'));

app.listen(port, '0.0.0.0', function() {
console.log("Listening on Port "+port);
});

I have the same issue but not able to fix it
Please help me to fix it

@johnKHill
Copy link

johnKHill commented Dec 15, 2018 via email

@misterdev
Copy link

@vincentaudebert do you know the reason why that doesn't work on free dynos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants