Gerrit Access Database Capability?

1,629 views
Skip to first unread message

simon....@siemens.com

unread,
Feb 15, 2017, 3:47:20 AM2/15/17
to Repo and Gerrit Discussion
Hi,

I am trying to access the gerrit database via ssh psql and stuck with the "does not have Access Database capability." message:

I did the following steps (with gerrit v2.12.7):

$ java -jar gerrit.war init -d ~/gerrit --batch --dev

$ git config -f gerrit/etc/gerrit.config --add capability.accessDatabase 'group Administrators'
$ git config -f gerrit/etc/gerrit.config --get capability.accessDatabase
group Administrators

$ ~/gerrit/bin/gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK

$ ssh -p 29418 admin@localhost gerrit ls-groups
Administrators
Non-Interactive Users

$ ssh -p 29418 admin@localhost gerrit gsql
fatal: admin does not have "Access Database" capability.

What am I doing wrong?

Best regards,
Simon

Edwin Kempin

unread,
Feb 15, 2017, 3:51:27 AM2/15/17
to simon....@siemens.com, Repo and Gerrit Discussion
On Wed, Feb 15, 2017 at 9:45 AM, <simon....@siemens.com> wrote:
Hi,

I am trying to access the gerrit database via ssh psql and stuck with the "does not have Access Database capability." message:

I did the following steps (with gerrit v2.12.7):

$ java -jar gerrit.war init -d ~/gerrit --batch --dev

$ git config -f gerrit/etc/gerrit.config --add capability.accessDatabase 'group Administrators'
$ git config -f gerrit/etc/gerrit.config --get capability.accessDatabase
group Administrators
Capabilities are not configured in gerrit.config, but in the project.config in the refs/meta/config branch of the All-Projects repository.
At best just assign this capability on the All-Projects project from the UI.
 

$ ~/gerrit/bin/gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK

$ ssh -p 29418 admin@localhost gerrit ls-groups
Administrators
Non-Interactive Users

$ ssh -p 29418 admin@localhost gerrit gsql
fatal: admin does not have "Access Database" capability.

What am I doing wrong?

Best regards,
Simon

--
--
To unsubscribe, email repo-discuss+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Sudler

unread,
Feb 15, 2017, 4:47:19 AM2/15/17
to Repo and Gerrit Discussion, simon....@siemens.com

Am Mittwoch, 15. Februar 2017 09:51:27 UTC+1 schrieb Edwin Kempin:


On Wed, Feb 15, 2017 at 9:45 AM, <simon....@siemens.com> wrote:
Hi,

I am trying to access the gerrit database via ssh psql and stuck with the "does not have Access Database capability." message:

I did the following steps (with gerrit v2.12.7):

$ java -jar gerrit.war init -d ~/gerrit --batch --dev

$ git config -f gerrit/etc/gerrit.config --add capability.accessDatabase 'group Administrators'
$ git config -f gerrit/etc/gerrit.config --get capability.accessDatabase
group Administrators
Capabilities are not configured in gerrit.config, but in the project.config in the refs/meta/config branch of the All-Projects repository.
At best just assign this capability on the All-Projects project from the UI.

Thx for the quick response ;-)

I am trying to avoid using the Web UI for a automated setup. The following steps are working for me:

$ git clone file:///home/gerrit/gerrit/git/All-Projects.git
$ git config -f All-Projects/project.config --add capability.accessDatabase 'group Administrators'
$ git -C All-Projects/ -c user.name='Gerrit Code Review' user.email='gerrit@hostname' commit -a -m"Add database access"
$ git -C All-Projects/ push origin HEAD:refs/meta/config

So is it a good approach to modify the All-Projects repo "manually"? Should I stop/restart/start gerrit? Are there any other implications?


Edwin Kempin

unread,
Feb 16, 2017, 2:35:46 AM2/16/17
to Simon Sudler, Repo and Gerrit Discussion
Yes, pushing updates to the refs/meta/config branch is fine.

 
Should I stop/restart/start gerrit?
A Gerrit restart is not needed.
 
Are there any other implications?
No.

Filip Stefanov

unread,
Feb 23, 2026, 3:14:00 AM (yesterday) Feb 23
to Repo and Gerrit Discussion
I was wondering what capabilities "Administrate Server" is granting by default?
Docs says: "They will also have all capabilities granted to them automatically."
Apparently that is not the case and we have to add some capabilities to Administrators group.

Reply all
Reply to author
Forward
0 new messages