LoginSignup
12
12

More than 5 years have passed since last update.

Slack + Hubot で v2 services token provided, please follow the upgrade instructionsと出るとき

Last updated at Posted at 2014-12-24

hubot-slack adapter が新しくなっている

SlackのHubot Integrationが知らぬ間にアップデートされてた - Qiita

連携が新しくなったんですね・・・

コレをちゃんと把握せずに、古いSlack Hubot Integrationで生成されたトークンを使って、新しいhubot-slackを使おうとするとエラーになります。

Hubot install

$ npm install -g yo generator-hubot
$ mkdir my-hubot
$ yo hubot

で新しいhubotを作った場合、Slackのアダプタも新しくなっているので要注意。
古いIntegrationで使ってたトークンをそのまま使おうとすると・・

v2 services token provided, please follow the upgrade instructions

と出て来てHubotが起動出来ない。

原因

参考URL: hubot-slack/slack.coffee at master · slackhq/hubot-slack

このメッセージのままググってみると、アダプタのソースコードがヒットしてくる。
よーく見てみると、

return @robot.logger.error "v2 services token provided, please follow the upgrade instructions" unless (options.token.substring(0, 5) == 'xoxb-')

と書いてあるところで引っかかっているので、トークンの頭5桁は新しいものだとxoxb-になってるので、それ以外のトークンを指定された場合は起動しないようになってました。

古いのを使い回す輩対策なんですね・・

新しいHubot Integrationを作ると、ちゃんと新しいトークンが出てくるので、あんまりこんなのにハマる人居ないかも・・

新しいのだと、HUBOT_SLACK_TOKENだけで良くなって、他の設定は要らなくなります。
HEROKU_URLとかもnpmのhubot-heroku-keepaliveなんかが入って要らなくなるみたいです。
↑間違えてました。
hubot-heroku-keepaliveで使う環境変数が、HEROKU_URLが非推奨になり、HUBOT_HEROKU_KEEPALIVE_URLを使うようになったそうです。

参考URL : hubot-scripts/hubot-heroku-keepalive

herokuにデプロイしてて、keep-aliveさせたければ

$ heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=PASTE_WEB_URL_HERE

せよ。とのことでした。

逆パターンで古いHubotのnpm versionのまま、新しいSlack Hubot Integrationやろうとする場合もハマるんだろうな。

12
12
0

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
12
12