Error retrieving the token

Hi @ahmaddanial

Thanks you for your answer.

  • Looks to me like we were on version 5.22 but I’m not sure there is a way to check this?
  • The error appears when authenticating with Gitlab, once I click on “Sign in” to login. By randomly I mean that sometimes I click on “Sign in” and this error does not appear. So if we’re already connected, we don’t get the error until at least the next reconnection if we’re unlucky.
  • In mattermost.log I have errors like:

{“level”:“error”,“ts”:1599722273.8641682,“caller”:“web/oauth.go:278”,“msg”:“AuthorizeOAuthUser: Erreur lors de la récupération du jeton, response_body={"error":"invalid_grant","error_description":"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}, status_code=401”}
{“level”:“error”,“ts”:1599722384.425674,“caller”:“web/oauth.go:278”,“msg”:“AuthorizeOAuthUser: Erreur lors de la récupération du jeton, response_body={"error":"invalid_grant","error_description":"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}, status_code=401”}
{“level”:“error”,“ts”:1599726406.3801544,“caller”:“mlog/log.go:175”,“msg”:“Error getting access token from DB before deletion.”,“path”:“/api/v4/users/logout”,“request_id”:“tq9455rn4trrzfufh3fi5q7ifo”,“ip_addr”:“192.168.6.55”,“user_id”:“d4rqtmbpx7gnjcui5imrecddye”,“method”:“POST”,“err_where”:“RevokeAccessToken”,“http_code”:400,“err_details”:“”}
{“level”:“error”,“ts”:1599726413.112087,“caller”:“mlog/log.go:175”,“msg”:“Error getting access token from DB before deletion.”,“path”:“/api/v4/users/logout”,“request_id”:“h8swnjd8nfbmupsm8y115nr7je”,“ip_addr”:“192.168.6.55”,“user_id”:“d4rqtmbpx7gnjcui5imrecddye”,“method”:“POST”,“err_where”:“RevokeAccessToken”,“http_code”:400,“err_details”:“”}

I watched this one: Mattermost - Token Request Failed when using Gitlab SSO (#2984) · Issues · GitLab.org / omnibus-gitlab · GitLab but that doesn’t mean anything to me, especially since I’m a novice in the field…

I also looked this one: [SOLVED] Mattermost Gitlab - Token request failed but I don’t have quite the same thing even though there it is looks like.