Username changed

49 views
Skip to first unread message

bomjose

unread,
Dec 15, 2010, 3:21:30 PM12/15/10
to Repo and Gerrit Discussion
Please help.

I initiated gerrit and then logged in with openid and set up my admin
account. After that i had to reinitialized my gerrit to add more
projects and after that i lost my username. As soon as i log in it ask
me to enter new ssh key and select new username with same openID. By
doing so i dont see any admin options. I need to go back to my
original username that i have set up so that i can gain control of my
original account. Please help how to do this...
Parthiv.

Shawn Pearce

unread,
Dec 15, 2010, 3:34:23 PM12/15/10
to bomjose, Repo and Gerrit Discussion

Was your OpenID provider Google or Yahoo by any chance? Did you
change the hostname or IP address your Gerrit server was accessed
through? Both of those providers generate different OpenID tokens for
each hostname or IP address, to prevent sites from comparing their
databases and tracking you on the web.

If you can't use the old hostname or IP to regain access to your old
account, you are going to need to edit the database by hand. Find
your old account in the accounts table, get its account_id. Find your
new account's account_id from the same table (or from the Settings
page in the web UI). Then issue an update to move the OpenID tokens
from the new account over to the old account:

UPDATE account_external_ids
SET account_id = OLD_ID
WHERE account_id = NEW_ID;

And restart your server. You can probably use `java -jar
bin/gerrit.war gsql -d .` to open a prompt to your database. If its
an H2 database, you'll need to stop the server to do it.

Parthiv Rawal

unread,
Dec 15, 2010, 5:15:12 PM12/15/10
to Shawn Pearce, Repo and Gerrit Discussion
Thank you for your answer.
OpenID provider is Google. Server has not changed IP address but we have assigned a new DNS entry for this server; does that matter?

I tried modifying database by hand but it is giving only following options
General
\q quit

Query Buffer
\g execute the query buffer
\p display the current buffer
\r clear the query buffer

Informational
\d list all tables
\d NAME describe table

How do I see values once I list all the tables? Sorry to ask dumb question.

Parthiv Rawal

unread,
Dec 15, 2010, 6:16:55 PM12/15/10
to Parthiv Rawal, Shawn Pearce, Repo and Gerrit Discussion
Thank you Shawn, I have reassign my user_id and now everything is working fine. Thank you for your help.

Here are the steps I did...
gerrit> select * FROM ACCOUNTS;
gerrit > UPDATE ACCOUNT_EXTERNAL_IDS SET ACCOUNT_ID = OLD_ID WHERE ACCOUNT_ID = NEW_ID


Thx,
Parthiv.

Parthiv Rawal

unread,
Dec 17, 2010, 3:03:21 PM12/17/10
to Parthiv Rawal, Shawn Pearce, Repo and Gerrit Discussion
Hello Shawn,
Do I need to flush cache in order to get updated database? When I got o Admin page to add any user to any project it gives an error " xxx is not a register user" code review error. Also I see more than one entry for this user in drop down menu for search user.

PARTHIV.

Reply all
Reply to author
Forward
0 new messages