'unable to log in to Gerrit - "name already in use"

A user who hasn't logged in to our Gerrit 2.10 instance for a few months tried to log in yesterday and got a "Forbidden" error. In the logs I see this:

[2022-05-05 11:09:47,829] ERROR com.google.gerrit.server.account.AccountManager : Cannot assign user name "redacted" to account 1000064; name already in use.
[2022-05-05 11:09:47,836] ERROR com.google.gerrit.httpd.auth.container.HttpLoginServlet : Unable to authenticate user "redacted"
com.google.gerrit.server.account.AccountUserNameException: Cannot assign user name "redacted" to account 1000064; name already in use.

It appears that he tried to re-register (more than once, in fact), which created a new user ID that no longer matches his user name. As a Gerrit admin, is there some way that I can view the user IDs and remove the ones that are bogus?

I just tried running this command, but it failed:

user@desktop=> ssh -p 29418 [email protected] gerrit set-account --delete-external-id 1000060 redacted
fatal: "--delete-external-id" is not a valid option


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source