LoginSignup
3

More than 5 years have passed since last update.

Botkit + Herokuで動かしていたslackbotがある日突然R10 (Boot timeout)エラーを吐き始めた時の対処法

Posted at

解決方法

botkit.slackbotを初期化する時に{hostname: '0.0.0.0'}を渡してあげる。

つまり、

var controller = botkit.slackbot({
  debug: false,
  json_file_store: './simple_storage/'
}).configureSlackApp({
  clientId: process.env.BOTKIT_SLACK_CLIENT_ID,
  clientSecret: process.env.BOTKIT_SLACK_CLIENT_SECRET,
  scopes: ['commands']
});

var controller = botkit.slackbot({
  hostname: '0.0.0.0', // <- これを追加
  debug: false,
  json_file_store: './simple_storage/'
}).configureSlackApp({
  clientId: process.env.BOTKIT_SLACK_CLIENT_ID,
  clientSecret: process.env.BOTKIT_SLACK_CLIENT_SECRET,
  scopes: ['commands']
});

にする。

環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.1
BuildVersion:   16B2555
$ node -v
v6.9.1
$ npm -v 
3.10.8

問題

前日までは全く問題なく動いていたのに、ある日ちょっとした修正をしていつも通りgit push heroku masterしてHerokuにデプロイすると、ちょうど1分後に

 :
 : 
2016-11-20T20: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-20T20:21:23.350453+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-20T20:21:23.496229+00:00 heroku[web.1]: Process exited with status 137
2016-11-20T20:21:23.498989+00:00 heroku[web.1]: State changed from starting to crashed

というエラーが発生して、slackbotがダウンしてしまう。

原因は不明だけど、このissueをみてとりあえずその通りにしたら治った。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3