[Solved] Token request failed: no Host in request URL

I just installed fresh copy of Mattermost v1.0.0 and running into following error as soon as I try to create a team via Gitlab SSO:

[10/15/15 16:09:55] [INFO] Starting Server…
[10/15/15 16:09:55] [INFO] Server is listening on 127.0.0.1:8065
[10/15/15 16:09:55] [INFO] RateLimiter is enabled
[10/15/15 16:10:02] [DEBG] /
[10/15/15 16:10:02] [DEBG] /api/v1/users/me
[10/15/15 16:10:12] [DEBG] /api/v1/teams/create_with_sso/gitlab
[10/15/15 16:10:12] [DEBG] /developers0/signup/gitlab
[10/15/15 16:10:13] [DEBG] /signup/gitlab/complete
[10/15/15 16:10:13] [EROR] /signup/gitlab/complete:AuthorizeOAuthUser code=500 rid=9texgczbop81dx5h67onn1638r uid= ip=10.250.20.52 Token request failed [details: Post https:///git.domain.local/oauth/token: http: no Host in request URL]

Hi @Maverik

Wondering if you have a typo here? (three ///)

Shouldn’t be my typo. That’s a copy paste of mattermost console log. I’ll rerun and double check.

Edit: double checked… That’s mattermost’s doing :smile: I have nginx in front. Also double checked it’s config and I don’t have a /// anywhere in there.

Any ideas yet on what I should check to get this fixed or post to help you figure it out?

can you

curl https://git.domain.local/oauth/token

and

curl https:///git.domain.local/oauth/token

from the cmd to see if you can route to that host?

Can you confirm what’s in your config.json ? I’ve looked at the code https://github.com/mattermost/platform/blob/master/api/user.go#L1565 and it’s just setting what’s in the config.json file without any modification. Maybe your proxy is re-directing/re-writing the url?

I found it! it was an error in config.json. So embarrassing! thank you good sir! Of the three, the middle one had an extra / in it that I couldn’t spot earlier until your comment made i look at it again more closely.