Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-14491

Constraint error “uniq_external_login”, upon attempting Log In with GitLab after user migration

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Web API
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      After migrating to new Gitlab instance, some users are unable to log in.

      Steps to reproduce:

      1. Setup SonarQube to authenticate users through GitLab as normal (ALM integration).
        #Prove it works: authenticate SonarQube using the “Log In with GitLab” button.
        #Make another one, with the same usernames as step 1. (Re)point SonarQube authentication to the new GitLab (as done in step 1). (In our case, the callback URL was the same, but the almintegration keys (Application ID and Secret) had to change since the GitLab instance was new.)
        #Repeat step 2. It will fail with some users, giving the constraint error.

      Technical notes:
      `org.sonar.server.authentication.UserRegistrarImpl#getUser` method tries to match Gitlab user with external id, which can match with different SonarQube user as gitlab user id can change after migration.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jacek.poreda Jacek Poreda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: