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

Created on 4 May 2015  路  6Comments  路  Source: slackapi/node-slack-sdk

My bot often crashes for the following error:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
State changed from starting to crashed
State changed from crashed to starting
Process exited with status 137

Is it a bug within node-slack-client or some settings with heroku that I'm missing?
According to this StackOverflow thread, you can fix it by telling your app to listen to a port that Heroku assign dynamically app.listen(process.env.PORT). But how can you do it with slack-client?

My code is here.

Most helpful comment

Had the exact issue with my bot on heroku. I just added a server that heroku could bind to and it worked perfectly.

http = require 'http'
handle = (req, res) -> res.end "hit"

server = http.createServer handle

server.listen process.env.PORT || 5000

All 6 comments

I got it working. Turn out it must be an app.

Hey @khanh-nguyen, does this still resolve the issue for you? I tried changing my Procfile and I still get the error.

Hey @khanh-nguyen did you resolve your issue by simply creating an app and not using it, or does the node-slack-client somehow integrate with it? Thanks.

Had the exact issue with my bot on heroku. I just added a server that heroku could bind to and it worked perfectly.

http = require 'http'
handle = (req, res) -> res.end "hit"

server = http.createServer handle

server.listen process.env.PORT || 5000

What file did you add this code to?

@lhelminiak you would add this to your main file, which be default is index.js, but in your app might be server.js or app.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dcsan picture dcsan  路  12Comments

mpcowan picture mpcowan  路  15Comments

hckhanh picture hckhanh  路  21Comments

aoberoi picture aoberoi  路  16Comments

danielravina picture danielravina  路  16Comments