Unable to view (accounts and account_external_ids) in Gerrit-2.15 of MYSQL DB

1,486 views
Skip to first unread message

Mohan Kumar

unread,
May 2, 2018, 6:33:27 AM5/2/18
to Repo and Gerrit Discussion

My Gerrit environment details,

 

Gerrit Version: 2.15

Database: MYSQL-5.7.22

Gerrit portal Authentication: Crowd (Microsoft AD based)

 

Problem:-

 

Recently we have upgraded our gerrit version from 2.14.7 to 2.15, post migration, I am unable to view the (accounts and account_external_ids) from our MYSQL DB.

 

I have gone through the release notes of gerrit –V-2.15 and found that accounts details are fully stored in NoteDB.

 

MYSQL Command - show tables; doesn’t show the account details, As I need to delete few user accounts from the MYSQL-DB, So could you help me to view and delete (accounts & account_external_ids) details from our MYSQL-DB.

Gert van Dijk

unread,
May 2, 2018, 6:53:54 AM5/2/18
to Repo and Gerrit Discussion
On Wednesday, 2 May 2018 12:33:27 UTC+2, Mohan Kumar wrote:

Recently we have upgraded our gerrit version from 2.14.7 to 2.15, post migration, I am unable to view the (accounts and account_external_ids) from our MYSQL DB.

 

I have gone through the release notes of gerrit –V-2.15 and found that accounts details are fully stored in NoteDB.

 

MYSQL Command - show tables; doesn’t show the account details, As I need to delete few user accounts from the MYSQL-DB, So could you help me to view and delete (accounts & account_external_ids) details from our MYSQL-DB.


You're already answering your own question here, right? Account data has moved from ReviewDb (backed by MySQL in your case) to NoteDb (in-Git, in the All-Users repository). So, the fact that you can't find any account data in your MySQL database any longer is expected and a feature of 2.15+.

Edwin Kempin

unread,
May 2, 2018, 6:58:52 AM5/2/18
to Gert van Dijk, Repo and Gerrit Discussion

--
--
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 the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohan Kumar

unread,
May 2, 2018, 7:45:00 AM5/2/18
to Repo and Gerrit Discussion

Team, So I need to add the below in our All-Users repository under access section correct?

If yes what all are the reference do I need add, please advise.

1) refs/users/* (user branches)

2) refs/meta/external-ids (external IDs)

3) refs/starred-changes/* (star labels)

4) refs/sequences/accounts (account sequence numbers, not needed for Gerrit slaves)

Edwin Kempin

unread,
May 2, 2018, 8:00:00 AM5/2/18
to moha...@gmail.com, Repo and Gerrit Discussion
On Wed, May 2, 2018 at 1:45 PM Mohan Kumar <moha...@gmail.com> wrote:

Team, So I need to add the below in our All-Users repository under access section correct?

If yes what all are the reference do I need add, please advise.

1) refs/users/* (user branches)

2) refs/meta/external-ids (external IDs)

3) refs/starred-changes/* (star labels)

4) refs/sequences/accounts (account sequence numbers, not needed for Gerrit slaves)

No, you don't need to do anything. These refs are entirely managed by Gerrit and should not be updated manually.

I just gave you this link because you said that you want to delete accounts manually. Since account deletion is not supported by Gerrit you would need to know which refs there are and what they are used for. However if you modify this data it's your responsibility to keep the data consistent (same as you need to keep your MYSQL-DB data consistent when you manually delete entries from it).

Mohan Kumar

unread,
May 2, 2018, 8:29:09 AM5/2/18
to Repo and Gerrit Discussion
Ok thank you for the clarification. Yes i would need to delete 3 accounts manually in our MYSQL DB. Earlier had deleted from DB. Now for the same when I tried to desc accounts it doesn't exists since it moved to NoteDB. Now I m looking for way to delete.

Mohan Kumar

unread,
May 2, 2018, 11:57:52 PM5/2/18
to Repo and Gerrit Discussion

Team, as per the release notes instruction (https://gerrit-review.googlesource.com/Documentation/config-accounts.html)  

I have cloned the ALL-Users repository locally and currently I am unable to view branches details, logs and folders inside in master branch. below screenshot is for reference.

 

 

Am i checking in right way or not, kindly guide me.

Gerrit-All-Users_Repo_Screenshot.png

Mohan Kumar

unread,
May 3, 2018, 1:38:55 AM5/3/18
to Repo and Gerrit Discussion
Also unable to checkout external-ids branch. i am using gerrit 2.15 Version.

$ git checkout refs/meta/external-ids
error: pathspec 'refs/meta/external-ids' did not match any file(s) known to git.

Edwin Kempin

unread,
May 3, 2018, 2:31:57 AM5/3/18
to moha...@gmail.com, Repo and Gerrit Discussion
On Thu, May 3, 2018 at 7:38 AM Mohan Kumar <moha...@gmail.com> wrote:
Also unable to checkout external-ids branch. i am using gerrit 2.15 Version.

$ git checkout refs/meta/external-ids
error: pathspec 'refs/meta/external-ids' did not match any file(s) known to git.
You must fetch this branch before you can check it out.
 

On Thursday, May 3, 2018 at 9:27:52 AM UTC+5:30, Mohan Kumar wrote:

Team, as per the release notes instruction (https://gerrit-review.googlesource.com/Documentation/config-accounts.html)  

I have cloned the ALL-Users repository locally and currently I am unable to view branches details, logs and folders inside in master branch. below screenshot is for reference.

The All-Users repository doesn't have a master branch.
The branches in All-Users don't live in the refs/heads/ namespace. This means when you clone the repository by default you don't get them fetched into your local repository. You should fetch them explicitly.
 

 

 

Am i checking in right way or not, kindly guide me.



On Wednesday, May 2, 2018 at 5:59:09 PM UTC+5:30, Mohan Kumar wrote:
Ok thank you for the clarification. Yes i would need to delete 3 accounts manually in our MYSQL DB. Earlier had deleted from DB. Now for the same when I tried to desc accounts it doesn't exists since it moved to NoteDB. Now I m looking for way to delete.

--

Mohan Kumar

unread,
May 3, 2018, 2:55:37 AM5/3/18
to Repo and Gerrit Discussion

Okay. I tried below steps, still couldn’t I am unable to get it.

1)      $ git clone ssh://moh...@100.101.102.103:29418/All-Users

Cloning into 'All-Users'...

warning: remote HEAD refers to nonexistent ref, unable to checkout.

2)      $ cd All-Users/

3)      $ git fetch --all

Fetching origin

4)      $ git branch –av

Edwin Kempin

unread,
May 3, 2018, 3:07:08 AM5/3/18
to moha...@gmail.com, Repo and Gerrit Discussion
On Thu, May 3, 2018 at 8:55 AM Mohan Kumar <moha...@gmail.com> wrote:

Okay. I tried below steps, still couldn’t I am unable to get it.

1)      $ git clone ssh://moh...@100.101.102.103:29418/All-Users

Cloning into 'All-Users'...

warning: remote HEAD refers to nonexistent ref, unable to checkout.

2)      $ cd All-Users/

3)      $ git fetch --all

Are you sure that this fetches non refs/heads/ branches?
Maybe try
git fetch origin refs/users/*
git fetch origin refs/meta/external-ids
etc.

David Pursehouse

unread,
May 3, 2018, 3:11:23 AM5/3/18
to Edwin Kempin, Repo and Gerrit Discussion, moha...@gmail.com


On Thu, 3 May 2018, 16:07 'Edwin Kempin' via Repo and Gerrit Discussion, <repo-d...@googlegroups.com> wrote:
On Thu, May 3, 2018 at 8:55 AM Mohan Kumar <moha...@gmail.com> wrote:

Okay. I tried below steps, still couldn’t I am unable to get it.

1)      $ git clone ssh://moh...@100.101.102.103:29418/All-Users

Cloning into 'All-Users'...

warning: remote HEAD refers to nonexistent ref, unable to checkout.

2)      $ cd All-Users/

3)      $ git fetch --all

Are you sure that this fetches non refs/heads/ branches?

The  --all option is to fetch from all remotes. I don't think it will fetch anything other than refs/heads and refs/tags unless explicitly specified. 

Edwin Kempin

unread,
May 3, 2018, 3:17:33 AM5/3/18
to David Pursehouse, Repo and Gerrit Discussion, moha...@gmail.com
Also as a heads up. You will not be able to delete user branches by pushing to the All-Users repository.
Gerrit protects the user branches and since account deletion is not supported it disallows deleting user branches by push.
If you want to delete user branches anyway you would need to do this on the server-side repository directly and hence bypass the Gerrit checks.

Mohan Kumar

unread,
May 3, 2018, 6:49:19 AM5/3/18
to Repo and Gerrit Discussion

Okay, is there any way is there to deactivate the user account instead of deleting. Also still I am unable to fetch the branches.

 

$ git fetch origin refs/users/*

fatal: Invalid refspec 'refs/users/*'

 

$ git fetch origin refs/meta/external-ids

fatal: Couldn't find remote ref refs/meta/external-ids

Gert van Dijk

unread,
May 3, 2018, 7:04:19 AM5/3/18
to Repo and Gerrit Discussion
It's pretty strange that you can't fetch the remote refs; they're really there. As Edwin indicated, try performing changes on the Gerrit server itself, in the bare repositories on the filesystem directly.

If you just want to deactivate accounts, I believe you should use the administrative SSH set-account command with the --inactive flag and not bother modifying stuff directly. But that's not different to the situation before with 2.14.x. I would strongly discourage anyone to modify ReviewDb/NoteDb backends directly for simple use cases like these. For such, Gerrit should provide admin commands like these.

Mohan Kumar

unread,
May 3, 2018, 8:24:11 AM5/3/18
to Repo and Gerrit Discussion
Hi Gert, Thank you. Acutally i was trying to clone from another machine which didn't work.then as per your instruction tried in gerrit server itself. I m able to view the accounts and extetnal I'D details.

Ok since directly modifying the repo files will impact the DB. So i will try to deactive the accounts through ssh.setaccount commands. Thanks team for continues help.

Mohan Kumar

unread,
May 7, 2018, 12:52:13 AM5/7/18
to Repo and Gerrit Discussion

Team,

$ ssh -p 29418 gerrit-server mohan.s set-account --full-name ‘Karthi Keyan S' --inactive

fatal: Gerrit Code Review: set-account: not found

 

Getting above error, do I need to add any settings in my gerrit.config file? Kindly confirm.

David Pursehouse

unread,
May 7, 2018, 1:41:19 AM5/7/18
to Mohan Kumar, Repo and Gerrit Discussion
On Mon, May 7, 2018 at 1:52 PM Mohan Kumar <moha...@gmail.com> wrote:

Team,

$ ssh -p 29418 gerrit-server mohan.s set-account --full-name ‘Karthi Keyan S' --inactive

fatal: Gerrit Code Review: set-account: not found


You are missing "gerrit" from the command.  I.e. it should be:

ssh -p 29418 gerrit-server mohan.s gerrit set-account --full-name ‘Karthi Keyan S' --inactive
 

 

Getting above error, do I need to add any settings in my gerrit.config file? Kindly confirm.



On Thursday, May 3, 2018 at 5:54:11 PM UTC+5:30, Mohan Kumar wrote:
Hi Gert, Thank you. Acutally i was trying to clone from another machine which didn't work.then as per your instruction tried in gerrit server itself. I m able to view the accounts and extetnal I'D details.

Ok since directly modifying the repo files will impact the DB. So i will try to deactive the accounts through ssh.setaccount commands. Thanks team for continues help.

--

Mohan Kumar

unread,
May 7, 2018, 2:07:04 AM5/7/18
to Repo and Gerrit Discussion

Yes it worked. Actually I thought gerrit is account login-id(same i replaced with my gerrit admin account). Thank you.

Reply all
Reply to author
Forward
0 new messages