Summary
Getting the message “Token request failed” when i try to authorize mattermost on gitlab.
Steps to reproduce
I followed the gitlab mattermost install page, i’m runing the whole gitlab environment in dockers (using official image)
Expected behavior
Describe your issue in detail
Observed behavior
Once i try to login on my mattermost env through gitlab, It keep telling my that the Token registration as been rejected.
-
Mattermost login page
httpsgyazo.com/f8b8bf58882361f07ba8180b897ad928 -
Mattermost authorization
[https]gyazo.com/5c7a05decf7640a090b7f07e069cee17 -
Token rejected
[https]gyazo.com/83acf34c6c2a4524381d4e1713179107 -
Gitlab logs
==> /var/log/gitlab/gitlab-rails/production.log <==
Started POST "/oauth/authorize" for 172.17.0.4 at 2016-12-12 08:26:34 +0000 Processing by Oauth::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"hV5Kc5q0KRgKZNmMAh49UdGSejbajoFKCIyrPtr3WkkHTReY6tES+agMno6VZcO2b3z+r0qv0pbjJaBl/VSljw==", "client_id"=>"8ff5c2c69203be0290d8e3f1f47b23781f84a544d760833bb87618da891d49ef", "redirect_uri"=>"https://mattermost.hsfactory.net/signup/gitlab/complete", "state"=>"eyJhY3Rpb24iOiJsb2dpbiIsImhhc2giOiIkMmEkMTAkV3lyOFBCNVliS05MMEJwMVZSS1BOZXJEanB2emhpR1l3YWc0NHlaaC96c252aVk5YUJFRW0ifQ==", "response_type"=>"code", "scope"=>"api"} Redirected to https://mattermost.company.com/signup/gitlab/complete?code=8426ea1804ada7bcabb0ec195e42b1817fa2ebbea65ccca1ab95ce425427b5b0&state=eyJhY3Rpb24iOiJsb2dpbiIsImhhc2giOiIkMmEkMTAkV3lyOFBCNVliS05MMEJwMVZSS1BOZXJEanB2emhpR1l3YWc0NHlaaC96c252aVk5YUJFRW0ifQ%3D%3D Completed 302 Found in 85ms (ActiveRecord: 16.0ms)
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-12-12_08:26:34.73912 git.company.com 172.17.0.4:49244 - - [2016-12-12 08:26:34.63540592 +0000 UTC] "POST /oauth/authorize HTTP/1.1" 302 326 "https://git.company.com/oauth/authorize?response_type=code&client_id=8ff5c2c69203be0290d8e3f1f47b23781f84a544d760833bb87618da891d49ef&redirect_uri=https%3A%2F%2Fmattermost.company.com%2Fsignup%2Fgitlab%2Fcomplete&state=eyJhY3Rpb24iOiJsb2dpbiIsImhhc2giOiIkMmEkMTAkV3lyOFBCNVliS05MMEJwMVZSS1BOZXJEanB2emhpR1l3YWc0NHlaaC96c252aVk5YUJFRW0ifQ%3D%3D" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36" 0.103534
==> /var/log/gitlab/mattermost/current <==
2016-12-12_08:26:34.83189 [2016/12/12 08:26:34 UTC] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=e95id3iwztfrzdkbqk5es959ew uid= ip=xxx.xxx.xxx.xxx Token request failed [details: Post https://git.company.com/oauth/token: dial tcp 172.17.0.3:443: getsockopt: connection refused]
==> /var/log/gitlab/mattermost/mattermost.log <==
[2016/12/12 08:26:34 UTC] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=e95id3iwztfrzdkbqk5es959ew uid= ip=xxx.xxx.xxx.xxx Token request failed [details: Post https://git.company.com/oauth/token: dial tcp 172.17.0.3:443: getsockopt: connection refused]
- Gitlab config
mattermost_external_url 'https://mattermost.company.com'
mattermost['enable'] = true
mattermost['service_use_ssl'] = true
mattermost_nginx['ssl_certificate'] = "/etc/letsencrypt/live/mattermost.company.com/fullchain.pem"
mattermost_nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/matteermost.company.com/privkey.pem"
mattermost['service_use_ssl'] = true
mattermost['service_address'] = "0.0.0.0"
mattermost['service_port'] = "8065"
mattermost['service_enable_incoming_webhooks'] = true
mattermost['service_enable_outgoing_webhooks'] = true
mattermost['service_enable_oauth_service_provider'] = true
mattermost['team_site_name'] = "Mattermost"
mattermost['team_enable_team_creation'] = true
mattermost['team_enable_user_creation'] = true
mattermost['team_allow_public_link'] = true
mattermost['gitlab_enable'] = true
mattermost['gitlab_secret'] = "f34a8493af9eb0f060ed767c308f890eae56a9d93e52e13e3310b502dd3f6ebe"
mattermost['gitlab_id'] = "8ff5c2c69203be0290d8e3f1f47b23781f84a544d760833bb87618da891d49ef"
mattermost['gitlab_scope'] = ""
mattermost['gitlab_auth_endpoint'] = "https://git.company.com/oauth/authorize"
mattermost['gitlab_token_endpoint'] = "https://git.company.com/oauth/token"
mattermost['gitlab_user_api_endpoint'] = "https://git.company.com/api/v3/user"
mattermost['email_enable_sign_up_with_email'] = true
mattermost['service_enable_insecure_outgoing_connections'] = true
I looked at every single setting again and again without success. Mail login is working.
PS: Sorry for gyazo’s link, as a new registered user, i can’"t post more than 1 image in a post, also edited links as i can only post 2 in a single post.