Gerrit postgresql Error

1,529 views
Skip to first unread message

Brian S

unread,
Mar 12, 2013, 1:26:57 PM3/12/13
to repo-d...@googlegroups.com
I recently finished setting up a testsite using a h2 database. I now am trying create a new deployment using a beefier database.

I read on this mailing-list that postgresql is the database of choice since it has been tested the most. To that end I have chosen to use a postgresql database on my new deployment. I receive the following error when i try to start gerrit.

ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
com.google.gerrit.pgm.util.Die: Unable to determine SqlDialect
caused by org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "gerrit2")
caused by org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "gerrit2"

My knowledge of postgresql is pretty limited so it is likely I have made errors trying to set this up. Here are my steps:

1. install postgresql-server on fedora.
# yum install postgresql-server

2. initialize datbase
# service postgresql initdb

3. switch to postgre user
# su -l postgres

4. Add user and enter password
-bash-4.2$ createuser -A -D -P -E gerrit2
enter password for new role

5. Create Database
-bash-4.2$ createdb -E UTF-8 -O gerrit2 reviewdb

Run Gerrit Setup

1. Login as gerrit user
# su - gerrit2

2. Run installer
$java -jar gerrit.war init -d /home/gerrit2/GerritApplication

3. Select Options to produce the following config (I removed ldap authentication settings and the database password is stored in the secure.config)

[gerrit]
  basePath = git
[database]
   type = POSTGRESQL
   hostname = localhost
   database = reviewdb
   username = gerrit2
[sendemail]
  smtpServer = localhost
  smtpUser = gerrit
[container]
  user = gerrit2
  javaHome = /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre
[sshd]
  listenAddress = *:29418
[httpd]
  listenUrl = http://*:8081/
[cache]
  directory = cache





Matthias Sohn

unread,
Mar 12, 2013, 5:19:08 PM3/12/13
to Brian S, Repo and Gerrit Discussion
searching for your error message on the postgres admin list finds this:

--
Matthias 

Brian S

unread,
Mar 13, 2013, 10:49:08 AM3/13/13
to repo-d...@googlegroups.com, Brian S

Thanks. Turns out I was using the incorrect pg_hba.conf file.  There is one in /var/lib/psql and one in /usr/share/postgresql

dylan....@enalean.com

unread,
Dec 2, 2013, 5:32:52 AM12/2/13
to repo-d...@googlegroups.com, Brian S
Hi, can you share the modifications you made to the pg_hba.conf file. I'm also new to postgresql and trying it out due to issues using gerrit with mysql.

Thanks.

Ian Kumlien

unread,
Dec 2, 2013, 5:50:02 AM12/2/13
to dylan....@enalean.com, Repo and Gerrit Discussion, Brian S
Hi, 

What issues did you have with MySQL?


On Mon, Dec 2, 2013 at 11:32 AM, <dylan....@enalean.com> wrote:
Hi, can you share the modifications you made to the pg_hba.conf file. I'm also new to postgresql and trying it out due to issues using gerrit with mysql.

Thanks.

--
--
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/groups/opt_out.

Dylan

unread,
Dec 2, 2013, 5:56:07 AM12/2/13
to Ian Kumlien, Repo and Gerrit Discussion, Brian S
Hi,

this is the specific issue I'm having with mysql
https://code.google.com/p/gerrit/issues/detail?id=2288

I don't have it when using the default H2 set-up so I’m concluding it's due to the type of database.
--

Share your knowledge of Tuleap with a patch
English French

David Pursehouse

unread,
Dec 2, 2013, 6:28:47 AM12/2/13
to Dylan, Ian Kumlien, Repo and Gerrit Discussion, Brian S
On 12/02/2013 07:56 PM, Dylan wrote:
> Hi,
>
> this is the specific issue I'm having with mysql
> https://code.google.com/p/gerrit/issues/detail?id=2288
>

From the issue description:

> I'm getting the following error when I try to add a new user on
> gerrit 2.5.2 via the set-account command-line option

Are you really using `set-account`? Or did you mean `create-account`?

The `set-account` command cannot be used with a user that does not yet
exist and should cause an error:

fatal: user "username" not found



> I don't have it when using the default H2 set-up so I’m concluding it's
> due to the type of database.
>
>
>
> On 12/02/2013 11:50 AM, Ian Kumlien wrote:
>> Hi,
>>
>> What issues did you have with MySQL?
>>
>>
>> On Mon, Dec 2, 2013 at 11:32 AM, <dylan....@enalean.com
>> <mailto:dylan....@enalean.com>> wrote:
>>
>> Hi, can you share the modifications you made to the pg_hba.conf
>> file. I'm also new to postgresql and trying it out due to issues
>> using gerrit with mysql.
>>
>> Thanks.
>> --
>> --
>> To unsubscribe, email repo-discuss...@googlegroups.com
>> <mailto:repo-discuss%2Bunsu...@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
>> <mailto:repo-discuss%2Bunsu...@googlegroups.com>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
> --
>
> Share your knowledge of Tuleap with a patch
> English <https://github.com/Enalean/tuleap-documentation-en> French
> <https://github.com/Enalean/tuleap-documentation-fr>

Dylan

unread,
Dec 2, 2013, 6:39:27 AM12/2/13
to David Pursehouse, Ian Kumlien, Repo and Gerrit Discussion, Brian S
yes, it really is set-account.

Maybe I'm exploiting a bug. I need a way to tell gerrit that an ldap user exists (in my situation 100s of users) so that I can add it to a group.

I can't rely on the individual users signing-in before the group is created so this workaround seemed to fix the problem of saying who is in a group before creating that group. Unfortunately, it only seems to work with H2.


�


On 12/02/2013 12:28 PM, David Pursehouse wrote:
On 12/02/2013 07:56 PM, Dylan wrote:
Hi,

this is the specific issue I'm having with mysql
https://code.google.com/p/gerrit/issues/detail?id=2288


From the issue description:

> I'm getting the following error when I try to add a new user on
> gerrit 2.5.2 via the set-account command-line option

Are you really using `set-account`?� Or did you mean `create-account`?

The `set-account` command cannot be used with a user that does not yet exist and should cause an error:

��� fatal: user "username" not found



I don't have it when using the default H2 set-up so I�m concluding it's
due to the type of database.



On 12/02/2013 11:50 AM, Ian Kumlien wrote:
Hi,

What issues did you have with MySQL?


On Mon, Dec 2, 2013 at 11:32 AM, <dylan....@enalean.com
<mailto:dylan....@enalean.com>> wrote:

��� Hi, can you share the modifications you made to the pg_hba.conf
��� file. I'm also new to postgresql and trying it out due to issues
��� using gerrit with mysql.

��� Thanks.
��� --
��� --
��� To unsubscribe, email repo-discuss...@googlegroups.com
��� <mailto:repo-discuss%2Bunsu...@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
��� <mailto:repo-discuss%2Bunsu...@googlegroups.com>.
��� For more options, visit https://groups.google.com/groups/opt_out.




--

Share your knowledge of Tuleap with a patch
English <https://github.com/Enalean/tuleap-documentation-en> French
<https://github.com/Enalean/tuleap-documentation-fr>

--
--
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/groups/opt_out.



--

Share your knowledge of Tuleap with a patch

Ian Kumlien

unread,
Dec 2, 2013, 6:47:26 AM12/2/13
to Dylan, David Pursehouse, Repo and Gerrit Discussion, Brian S
Ah, but if you use ldap to authenticate users, then why don't you use ldap groups to group them?

Then you'd have no need to precreate the users to add them to groups..

Dylan

unread,
Dec 2, 2013, 7:44:27 AM12/2/13
to Ian Kumlien, David Pursehouse, Repo and Gerrit Discussion, Brian S
Unfortunately, using ldap groups is not an option. I have groups based on ldap users in a third-party application. The third-party application has no control over ldap groups.

I wonder, would what I'm trying to do work in the latest version of gerrit via RESt?






On 12/02/2013 12:47 PM, Ian Kumlien wrote:
Ah, but if you use ldap to authenticate users, then why don't you use ldap groups to group them?

Then you'd have no need to precreate the users to add them to groups..



Manuel Vacelet

unread,
Dec 5, 2013, 4:23:23 AM12/5/13
to David Pursehouse, Dylan, Ian Kumlien, Repo and Gerrit Discussion, Brian S
On Mon, Dec 2, 2013 at 12:28 PM, David Pursehouse <david.pu...@sonymobile.com> wrote:
On 12/02/2013 07:56 PM, Dylan wrote:
Hi,

this is the specific issue I'm having with mysql
https://code.google.com/p/gerrit/issues/detail?id=2288


From the issue description:

> I'm getting the following error when I try to add a new user on
> gerrit 2.5.2 via the set-account command-line option

Are you really using `set-account`?  Or did you mean `create-account`?

The `set-account` command cannot be used with a user that does not yet exist and should cause an error:


Is that true with LDAP connexion too ?

For the record gerrit 2.8 does support it seamlessly (even set-members does it).
Is it safe to assume this behaviour is correct and we can leverage on it ?
 
Manuel
Reply all
Reply to author
Forward
0 new messages