Mattermost, Inc.

Token request failed

Hi,

I’ve been installed the last gitlab-mattermost and following step by step the howto to activate de SSO built in but I got this error:

> ==> /var/log/gitlab/gitlab-rails/production.log <==
> Started GET "/oauth/authorize?response_type=code&client_id=9476c971a4e9f31e507ad9cef2937d62c12808e5d2179e02f148dbfd4fe4590f&redirect_uri=https%3A%2F%2Fsland.tech%2Fsignup%2Fgitlab%2Fcomplete&state=eyJoYXNoIjoiJDJhJDEwJEJjQ25CREJSb1ZpZXI2YndrMjdGVS41MklXNkJFYmtna2wyVXNBbnBjRjF2dkpndTBFTy5lIiwidGVhbSI6ImFyZHVpbm8wMTIzNDU2Nzg5In0%3D" for 181.39.192.168 at 2015-09-25 02:32:04 -0500
> Processing by Oauth::AuthorizationsController#new as HTML
>   Parameters: {"response_type"=>"code", "client_id"=>"9476c971a4e9f31e507ad9cef2937d62c12808e5d2179e02f148dbfd4fe4590f", "redirect_uri"=>"https://sland.tech/signup/gitlab/complete", "state"=>"eyJoYXNoIjoiJDJhJDEwJEJjQ25CREJSb1ZpZXI2YndrMjdGVS41MklXNkJFYmtna2wyVXNBbnBjRjF2dkpndTBFTy5lIiwidGVhbSI6ImFyZHVpbm8wMTIzNDU2Nzg5In0="}
> Completed 200 OK in 79ms (Views: 56.9ms | ActiveRecord: 12.2ms)
> Started POST "/oauth/authorize" for 181.39.192.168 at 2015-09-25 02:32:06 -0500
> Processing by Oauth::AuthorizationsController#create as HTML
>   Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "client_id"=>"9476c971a4e9f31e507ad9cef2937d62c12808e5d2179e02f148dbfd4fe4590f", "redirect_uri"=>"https://sland.tech/signup/gitlab/complete", "state"=>"eyJoYXNoIjoiJDJhJDEwJEJjQ25CREJSb1ZpZXI2YndrMjdGVS41MklXNkJFYmtna2wyVXNBbnBjRjF2dkpndTBFTy5lIiwidGVhbSI6ImFyZHVpbm8wMTIzNDU2Nzg5In0=", "response_type"=>"code", "scope"=>"api"}
> Redirected to https://sland.tech/signup/gitlab/complete?code=0ef6ece6b75952874cf76b1eb96c2027c650924a360f9b257f7c69e5fd33c37d&state=eyJoYXNoIjoiJDJhJDEwJEJjQ25CREJSb1ZpZXI2YndrMjdGVS41MklXNkJFYmtna2wyVXNBbnBjRjF2dkpndTBFTy5lIiwidGVhbSI6ImFyZHVpbm8wMTIzNDU2Nzg5In0%3D
> Completed 302 Found in 19ms (ActiveRecord: 5.6ms)
> ==> /var/log/gitlab/mattermost/current <==
> 2015-09-25_07:32:06.47690 [09/25/15 02:32:06] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=6jbc5d83oin7pnq6mgp18w94ar uid= ip=181.39.192.168 Token request failed [details: Post https://git.sland.tech/oauth/token: x509: certificate is valid for rdi.sland.tech, sland.tech, not git.sland.tech]

Thanks in advance,


Jhoanir Torres

Sorry for delay, seems like certificate is not valid?

I get same message in my setup.
I have hosted gitlab and mattermost in port 8000 and port 9000 on same server.
I have enabled ssl and created one certificate/key for the server ip.

When I create a new Team in Mattermost, it redirects to gitlab for login. Once loggedin gitlab shows a screen to Authorize or deny. When I click the Authorize button, I get the message "GitLab Mattermost needs your help:Token request failed"
Can any one help me to resolve this error?

I get the same error as you. No SSL setup in my case.

==> /var/log/gitlab/gitlab-rails/production.log <==
Started POST “/oauth/authorize” for 127.0.0.1 at 2016-05-05 09:00:20 -0400
Processing by Oauth::AuthorizationsController#create as HTML
Parameters: {“utf8”=>“✓”, “authenticity_token”=>"[FILTERED]", “client_id”=>“xxxxxx”, “redirect_uri”=>“http://xxxxxx/signup/gitlab/complete”, “state”=>“xxxxx=”, “response_type”=>“code”, “scope”=>“api”, “commit”=>“Authorize”}
Redirected to http://xxxxxx/signup/gitlab/complete?code=xxx&state=xxxx%3D
Completed 302 Found in 13ms (ActiveRecord: 2.4ms)

==> /var/log/gitlab/gitlab-workhorse/current <==
2016-05-05_13:00:20.27512 migrationgit.druide @ - - [2016-05-05 09:00:20.252803743 -0400 EDT] “POST /oauth/authorize HTTP/1.1” 302 364 “http://xxxx/oauth/authorize?response_type=code&client_id=xxxx&redirect_uri=http%3A%2F%xxxxx%2Fsignup%2Fgitlab%2Fcomplete&state=xxxxx%3D” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17” 0.022197

==> /var/log/gitlab/nginx/gitlab_access.log <==
192.168.1.155 - - [05/May/2016:09:00:20 -0400] “POST /oauth/authorize HTTP/1.1” 302 364 “http://xxxx/oauth/authorize?response_type=code&client_id=xxxx&redirect_uri=http%3A%2F%2Fmattermost.druide%2Fsignup%2Fgitlab%2Fcomplete&state=xxxxxx%3D” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17”

==> /var/log/gitlab/mattermost/mattermost.log <==
[2016/05/05 09:00:20 EDT] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=xxxxxx uid= ip=192.168.1.155 Erreur lors de la récupération du jeton [details: ]

==> /var/log/gitlab/nginx/gitlab_mattermost_access.log <==
192.168.1.155 - - [05/May/2016:09:00:20 -0400] “GET /signup/gitlab/complete?code=xxxxx&state=xxxxxxx%3D HTTP/1.1” 500 1348 “http://xxxxx/oauth/authorize?response_type=code&client_id=xxxxx&redirect_uri=http%3A%2F%2Fmattermost.druide%2Fsignup%2Fgitlab%2Fcomplete&state=xxxxxx%3D” "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17"
192.168.1.155 - - [05/May/2016:09:00:20 -0400] “GET /static/js/react-with-addons-0.13.3.min.js HTTP/1.1” 404 19 “http://mattermost.druide/signup/gitlab/complete?code=xxxx&state=xxxxx%3D” "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17"
192.168.1.155 - - [05/May/2016:09:00:20 -0400] “GET /static/js/react-bootstrap-0.25.1.min.js HTTP/1.1” 404 19 “http://mattermost.druide/signup/gitlab/complete?code=xxxx&state=xxxx%3D” "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17"
192.168.1.155 - - [05/May/2016:09:00:20 -0400] “GET /static/js/jquery-1.11.1.min.js HTTP/1.1” 404 19 “http://mattermost.druide/signup/gitlab/complete?code=xxxxx&state=xxxx%3D” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17”