Cannot login after editing email addresses

前端 未结 2 1551
长发绾君心
长发绾君心 2021-01-15 05:05

I have Gerrit v3.0.0 running on my server, everything was working fine yesterday.

Here\'s my authentication method :

[auth]
    type = http
         


        
相关标签:
2条回答
  • 2021-01-15 05:13

    For people who got stuck in this nightmare, there is a guide which describes how to deal with this kind of issues.

    As the guide describes: you need to directly edit the External ID database and remove all the misbehaving External ID entries. Starting with Gerrit 2.15 the database got migrated to NoteDb so brace yourself.

    0 讨论(0)
  • 2021-01-15 05:24

    So it appears I was on the right path after all.

    What I did :

    Cause of the bug

    I changed the email of my account, and then changed the preferred email. Gerrit doesn't seem to support that and messed up with the external-id's.

    Cause of the second bug

    I deleted the external-id for the account I couldn't log in to (Either use API endpoints https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html or fetch All-Users:refs/meta/external-id)

    But I deleted not only the mailto:<my_username>@<domain>.com external-id but also gerrit:<my_username>.

    After that, nothing I tried allowed me to log back in again.

    Resolution

    • I cloned external ids using git clone "ssh://<my_username>@<domain>.com:<port>/All-Users" && git fetch origin refs/meta/external-ids && git checkout FETCH_HEAD
    • I created a new external-id in All-Users:refs/meta/external-id with the following:
        [externalId "gerrit:<my_username>"]
            accountId = <my_account_id>
            email = <my_username>@<domain>.com
    

    Note: the name of this file is the SHA1 of gerrit:<my_username>.

    • I pushed my changes to Gerrit with git push origin HEAD:refs/meta/external-ids

    Note: You need to edit All-Users accesses in order to be allowed to push this.

    And it all worked again.

    Feel free to add anything to this, it might not be very thorough.

    0 讨论(0)
提交回复
热议问题