I have Gerrit v3.0.0 running on my server, everything was working fine yesterday.
Here\'s my authentication method :
[auth]
type = http
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.
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
git clone "ssh://<my_username>@<domain>.com:<port>/All-Users" && git fetch origin refs/meta/external-ids && git checkout FETCH_HEAD [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>.
git push origin HEAD:refs/meta/external-idsNote: 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.