How to delete email id in gerrit

277 views
Skip to first unread message

kirank....@gmail.com

unread,
Sep 16, 2021, 11:03:52 AM9/16/21
to Repo and Gerrit Discussion
Hi Team,

Needed some guidance on deleting email ID.

One user in our project updated their username. When user try to login gerrit, new account ID is getting generated.

As email id is already used by old username, Gerrit can't allow to login with new username.
As email id should be unique for each account, we tried to delete the email id linked to old username.

But, gerrit won't allow to delete email.

ssh -p 22 user...@gerrit-ssh.company.net gerrit set-account --delete-email a...@email.com username
fatal: Cannot remove e-mail 'a...@email.com' which is directly associated with LDAP authentication

I remember, we could able to delete email in old version But, not now.

Can you please let us know, what is current approach to delete email id's ?

davidch...@gmail.com

unread,
Sep 17, 2021, 1:30:25 AM9/17/21
to Repo and Gerrit Discussion
Hi,

Can you please let us know, what is current approach to delete email id's ?
Please check if below link is helping you.

HTH,
Challs 

kiran mandala

unread,
Sep 19, 2021, 4:11:40 PM9/19/21
to davidch...@gmail.com, Repo and Gerrit Discussion
Thanks for your reply.

I tried the steps as mentioned. add dummy email, set preferred email and delete email.

But getting error message:

fatal: Cannot remove e-mail 'user...@abc.com' which is directly associated with LDAP authentication

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/rEXv66Mv7Mk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/4cca13ab-9e1f-49fe-9c33-c90acaa5ba86n%40googlegroups.com.

kirank....@gmail.com

unread,
Sep 22, 2021, 7:09:49 AM9/22/21
to Repo and Gerrit Discussion
Followed below steps to delete email id in All-Users.git repo.

  1. Checkout All-Users project from gerrit server

git clone server_path/All-Users.git

  1. Checkout ref refs/meta/external-ids

git fetch origin refs/meta/external-ids:refs/meta/external-ids
git checkout refs/meta/external-ids

  1. Search the account you want to update, e.g. foobar

grep foobar *

398cd83a701a63c77dfc1998f76524561208c879:[externalId "gerrit:foobar"]
398cd83a701a63c77dfc1998f76524561208c879:   email = foo...@example.com
9b622a00bcd48295d545ba946afdd91df8b0ed61:[externalId "username:foobar"]

  1. update those files and commit

git add 398cd83a701a63c77dfc1998f76524561208c879 9b622a00bcd48295d545ba946afdd91df8b0ed61
git commit -m "update email id for account foobar"
git push origin HEAD:refs/meta/external-ids


Reply all
Reply to author
Forward
0 new messages