Cannot login after editing email addresses

前端 未结 2 1552
长发绾君心
长发绾君心 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: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:@.com external-id but also gerrit:.

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

    Resolution

    • I cloned external ids using git clone "ssh://@.com:/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:"]
            accountId = 
            email = @.com
    

    Note: the name of this file is the SHA1 of gerrit:.

    • 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.

提交回复
热议问题