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

0.4.0 to 0.4.1 Introduced WebServer Issue #491

Closed
TheJimFactor opened this issue Nov 10, 2016 · 6 comments
Closed

0.4.0 to 0.4.1 Introduced WebServer Issue #491

TheJimFactor opened this issue Nov 10, 2016 · 6 comments
Labels

Comments

@TheJimFactor
Copy link

@TheJimFactor TheJimFactor commented Nov 10, 2016

When using the setupWebServer function from the slack button example - https://github.com/howdyai/botkit/blob/master/examples/slackbutton_bot.js I'm getting an error on Heroku saying that it is failing to bind to $PORT. Can we get a fix for this?

My botkits that are running version 0.4.0 will succeed and not crash on the binding part.

2016-11-10T20:21:23.350453+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-10T20:21:23.496229+00:00 heroku[web.1]: Process exited with status 137
2016-11-10T20:21:23.498989+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-10T20:21:23.499850+00:00 heroku[web.1]: State changed from crashed to starting
2016-11-10T20:21:26.665760+00:00 heroku[web.1]: Starting process with command node index.js
2016-11-10T20:21:28.940069+00:00 app[web.1]: info: ** Using simple storage. Saving data to ./db_slackbutton_bot/
2016-11-10T20:21:28.975754+00:00 app[web.1]: info: ** Setting up custom handlers for processing Slack messages
2016-11-10T20:21:28.976059+00:00 app[web.1]: info: ** Configuring app as a Slack App!
2016-11-10T20:21:29.004855+00:00 app[web.1]: info: ** Starting webserver on port 31667
2016-11-10T20:21:29.005157+00:00 app[web.1]: info: ** Serving webhook endpoints for Slash commands and outgoing webhooks at: http://127.0.0.1:31667/slack/receive
2016-11-10T20:21:29.006160+00:00 app[web.1]: info: ** Serving login URL: http://127.0.0.1:31667/login
2016-11-10T20:21:29.006386+00:00 app[web.1]: info: ** Serving oauth return endpoint: http://127.0.0.1:31667/oauth
2016-11-10T20:21:23.350453+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-11-10T20:21:23.350453+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-10T20:21:23.496229+00:00 heroku[web.1]: Process exited with status 137
2016-11-10T20:21:23.498989+00:00 heroku[web.1]: State changed from starting to crashed

@peterswimm

This comment has been minimized.

Copy link
Collaborator

@peterswimm peterswimm commented Nov 10, 2016

@jonchurch can you confirm your recent change?
00d1ba0
@TheJimFactor can you try removing that change marked above and see if that fixes your issue?

@jonchurch

This comment has been minimized.

Copy link
Contributor

@jonchurch jonchurch commented Nov 11, 2016

Hmmm I will try to replicate this when I am back at my computer later tonight.

At first glance, it is likely heroku passes process.env.PORT instead of process.env.port, but my PR isn't a breaking change for that. I would first change lines 30 and 47 to process.env.PORT and see if that fixes it.

@colestrode

This comment has been minimized.

Copy link
Contributor

@colestrode colestrode commented Nov 11, 2016

FWIW, I'm able to get my own Slash command bot running on 0.4.1 with no code changes. I think this is at worst a bug in the example, not Botkit itself.

@EliKrumholz

This comment has been minimized.

Copy link
Contributor

@EliKrumholz EliKrumholz commented Nov 13, 2016

I ran into the same issue, heroku expects the default http/express hostname, which is 0.0.0.0, not the default used by botkit, which is 127.0.0.1. #492

Try passing in 0.0.0.0 as the hostname to see if this fixes your issue.
var controller = Botkit.slackbot({ hostname: '0.0.0.0' });

@danielckv

This comment has been minimized.

Copy link

@danielckv danielckv commented Nov 14, 2016

I had the same issue with Heroku servers -> you should use your process environment PORT VAR and to set your hostname to 0.0.0.0 as for now the default hostname in Botkit is set to 127.0.0.1

@TheJimFactor

This comment has been minimized.

Copy link
Author

@TheJimFactor TheJimFactor commented Nov 16, 2016

Thanks for the hostname setting tip, I'll try that out in my next botkit bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.