GitLab integration fails to make a new user for an existing team

I stumbled upon a weird behaviour when using the GitLab authentication.

When I try to make a new user (for an existing team) via mail address it works without a problem. When I then try to create a new user using GitLab authentication I get the error:

[Mattermost-installation-name] needs your help:
We couldn’t find the existing account

The log reads:

[2015/10/28 15:44:30 CET] [EROR] /login/gitlab/complete:SqlUserStore.GetByAuth
code=500 rid=8puahuqrwjrg5jrywqbaeskfyc uid= ip= We couldn’t
find the existing account [details: teamId=j1m8w6r9apdd3xbng493cujmhh,
authData=90, authService=gitlab, sql: no rows in result set]

If however I create a new team using GitLab authentication it runs through and successfully creates the team and the user account.

The email options did not make any difference, i.e. whether mail verification was on or off, registrations by mail allowed or disallowed, or mail notifications enabled or disabled.

How can I tackle this problem? I don’t even know where to look, because in principle it already works.

Setup: precompiled version 1.1 on Debian 7 with postgres locally installed. No proxy so far and running on default port 8065. The GitLab installation runs on a different server but between the two http, https and port 8065 (all tcp) are allowed in the firewall.

Any suggestions are welcome!

Hi @reach3r, just to check a couple of things:

  1. Can you let us know the URL you’re using to create the new account?

  2. Can you confirm the GitLab SSO account you’re using to create a new Mattermost user is not using the same email address as a previously created account?

Hey @it33

to 1.: assuming you mean the exact URL from the address bar at that point, I can reproduce it tomorrow in the office (working in germany (UTC+01) and currently out of office and did not take my laptop with me for a change) and post it here. If you mean a different URL, please clarify.

Edit: http://[our-mattermost-server]:8065/login/gitlab/complete?code=4cf13e21601af12a5e1032768d6cf5063be69b866007420375ee6cf210afea22&state=eyJoYXNoIjoiJDJhJDEwJHNKaTdlRzREVHZlbDRPaDAuMzB4LmVrckVJMHlFaUk4LkV2bnVVUU1MMURNRy9GdnJlaDdtIiwidGVhbSI6InR0dHR0In0%3D

to 2.: Yes I can. It is a mistake I have made earlier while experimenting, but wanted to exclude that cause when trying to get a reproduceable result for the appearing error during GitLab authentication.

@reach3r I am getting the same error while signing up using the invitation link. If I create a new user account then things work perfectly fine but not for the invited user. I am using the unique email id which I haven’t used previously. Did you get the solution of this problem?? If yes, kindly tell what I am missing in here. The same thing is working in my Development environment though.

@usmanarif if I remember correctly it was an issue that was fixed with a new version soon after I started the thread.
I’m not sure if that helps, sorry!