2017年1月27日金曜日

MatterMost hook executed successfully but returned http reponse 500

  • このエントリーをはてなブックマークに追加


MatterMost hook executed successfully but returned http reponse 500

Gitlab オンプレミス版インストールしたので、内蔵されているSlcakのクローン版MatterMostとの連携をしてみました。

MatterMostを有効にする

  • デフォルトではMatterMostが無効になっているため、有効にする必要がある。
# vi /etc/gitlab/gitlab.rb
mattermost_external_url 'http://mattermost.test.com'

Gitlabと違うドメイン名が推奨されてますが、同じドメイン名でポート番号だけ変えればOK。

例えば
http://10.10.100.1:9999

  • GitlabをReconfigure
sudo gitlab-ctl reconfigure

これでURLからアクセスできるようになる。Teamを作って、招待リングを作って関係者招待すればOK

参考
https://docs.gitlab.com/omnibus/gitlab-mattermost/

GitlabとMatterMost連携

MatterMostでWebHookを有効

Teamを右クリック → System console → Service Settings 以下の項目をTrueにする

  • Enable Incoming Webhooks: true
    When true, incoming webhooks will be allowed. To help combat phishing attacks, all posts from webhooks will be labelled by a BOT tag.
  • Enable Outgoing Webhooks: true
    When true, outgoing webhooks will be allowed.
  • Enable Slash Commands: true
    When true, user created slash commands will be allowed.
  • Enable Integrations for Admin Only: true
    When true, user created integrations can only be created by admins.
  • Enable Overriding Usernames from Webhooks and Slash Commands: true
    When true, webhooks and slash commands will be allowed to change the username they are posting as. Note, combined with allowing icon overriding, this could open users up to phishing attacks.
  • Enable Overriding Icon from Webhooks and Slash Commands: true

上記項目を有効にしないと、matterMostのIntegration画面が表示されない。

チャンネルごとにWebHook用URLを作成

Teamを右クリック → Account Settings → Integrations → Incoming Webhooks
対応チャネルを選択し、ADDで追加する。URLが表示されます。

GitlabでWebHook設定

最初に Gitlabプロジェクト → Settings → WebHooks画面でMatterMostのURLを追加したのですが、以下のエラーが表示されます。

Error

hook executed successfully but returned http reponse 500

色々調べたところ、どうやら、Webhooks画面ではなく、Services画面でSlackを有効にして、MatterMostのWebhook URLとチャンネル名入力してできました。

解決

DO NOT create webhook in Gitlab from Projects Settings > Webhooks page.
DO create webhook from Projects Settings > Services > Slack page

この記事がお役にたちましたらシェアをお願いします:)

  • このエントリーをはてなブックマークに追加

0 件のコメント:

コメントを投稿