Gerrit init fails, causing gerritadmin user to not be able to see All-Projects repository

190 views
Skip to first unread message

Claudio DeSouza

unread,
Nov 6, 2018, 12:26:59 PM11/6/18
to Repo and Gerrit Discussion
Hi,

I'm really struggling to get gerrit to run through docker-compose. I can have a brand new install of Ubuntu 18.4, with a single user added to the docker group, and all sorts of failures still happen when trying to follow the very instructions that come with the gerrit image itself.

For instance, lately, I'm getting the following error when trying to initialise gerrit

Attaching to infra_gerrit_1
gerrit_1      | Generating SSH host key ... rsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done
gerrit_1      | Exception in thread "main" com.google.gwtorm.server.OrmException: Error in index_postgres.sql:
gerrit_1      | ALTER TABLE account_group_members CLUSTER ON account_group_members_pkey;
gerrit_1      | at com.google.gerrit.server.schema.ScriptRunner.run(ScriptRunner.java:67)
gerrit_1      | at com.google.gerrit.server.schema.SchemaCreator.create(SchemaCreator.java:174)
gerrit_1      | at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:111)
gerrit_1      | at com.google.gerrit.pgm.init.BaseInit$SiteRun.upgradeSchema(BaseInit.java:383)
gerrit_1      | at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:144)
gerrit_1      | at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
gerrit_1      | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
gerrit_1      | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
gerrit_1      | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
gerrit_1      | at java.lang.reflect.Method.invoke(Method.java:498)
gerrit_1      | at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:226)
gerrit_1      | at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:122)
gerrit_1      | at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:66)
gerrit_1      | at Main.main(Main.java:28)
gerrit_1      | Caused by: org.postgresql.util.PSQLException: ERROR: relation "account_group_members" does not exist
gerrit_1      | at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
gerrit_1      | at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
gerrit_1      | at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
gerrit_1      | at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
gerrit_1      | at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
gerrit_1      | at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
gerrit_1      | at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
gerrit_1      | at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
gerrit_1      | at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
gerrit_1      | at com.google.gerrit.server.schema.ScriptRunner.run(ScriptRunner.java:65)
gerrit_1      | ... 13 more
infra_gerrit_1 exited with code 1

If I rerun docker-compose up, then no error happens and it tells me that everything is ok, however as soon as a start gerrit, the gerritadmin user has no access to any of the projects, even though the user shows as a member of the administrator project.

My docker-compose is exactly like the one in the readme found at https://gerrit.googlesource.com/docker-gerrit.

I thought I was past this problem but it seems it keeps creeping in.

Can anyone help me please.

Sébastien Guilbaud

unread,
Nov 21, 2018, 3:14:54 AM11/21/18
to Repo and Gerrit Discussion
Same exception here on a fresh 18.04 vm with Gerrit 2.16 / pgsql 11.1.

As groups are now stored in NoteDB (2.16 change), maybe this index should be removed ?


Claudio DeSouza

unread,
Nov 21, 2018, 12:40:21 PM11/21/18
to Repo and Gerrit Discussion
Is there anything that I can do to solve this?

Kevin Navero

unread,
Dec 3, 2018, 2:18:27 AM12/3/18
to Repo and Gerrit Discussion
I'm running into the same thing after gerrit init gets passed plugin installation. My environment is Windows 7, postgresql 11.0, gerrit-2.16. I'm going to try another version of gerrit or postgres and see if that makes any difference. Has anyone found a solution for this yet?

Hugo Arès

unread,
Dec 3, 2018, 10:24:21 PM12/3/18
to Repo and Gerrit Discussion
Gerrit 2.16 is broken for a new site with postgres, I fixed it in https://gerrit-review.googlesource.com/c/gerrit/+/206170

Once this is merged, either you build latest stable-2.16 branch or wait for release of 2.16.1

Hugo

luca.mi...@gmail.com

unread,
Dec 4, 2018, 1:59:10 AM12/4/18
to Repo and Gerrit Discussion, Hugo Arès


Sent from my iPhone

On 4 Dec 2018, at 03:24, Hugo Arès <hug...@gmail.com> wrote:

Gerrit 2.16 is broken for a new site with postgres, I fixed it in https://gerrit-review.googlesource.com/c/gerrit/+/206170

Once this is merged, either you build latest stable-2.16 branch or wait for release of 2.16.1

Hugo

On Monday, December 3, 2018 at 2:18:27 AM UTC-5, Kevin Navero wrote:
I'm running into the same thing after gerrit init gets passed plugin installation. My environment is Windows 7, postgresql 11.0, gerrit-2.16. I'm going to try another version of gerrit or postgres and see if that makes any difference. Has anyone found a solution for this yet?

What is the purpose of using PostgreSQL with NoteDB and Gerrit 2.16?

There is only the schema_version table with a single row which is never changed.

Luca

--
--
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.

David Ostrovsky

unread,
Dec 4, 2018, 2:24:07 AM12/4/18
to Repo and Gerrit Discussion

On Tuesday, December 4, 2018 at 7:59:10 AM UTC+1, lucamilanesio wrote:


Sent from my iPhone

On 4 Dec 2018, at 03:24, Hugo Arès <hug...@gmail.com> wrote:

Gerrit 2.16 is broken for a new site with postgres, I fixed it in https://gerrit-review.googlesource.com/c/gerrit/+/206170

Once this is merged, either you build latest stable-2.16 branch or wait for release of 2.16.1

Hugo

On Monday, December 3, 2018 at 2:18:27 AM UTC-5, Kevin Navero wrote:
I'm running into the same thing after gerrit init gets passed plugin installation. My environment is Windows 7, postgresql 11.0, gerrit-2.16. I'm going to try another version of gerrit or postgres and see if that makes any difference. Has anyone found a solution for this yet?

What is the purpose of using PostgreSQL with NoteDB and Gerrit 2.16?

NoteDb migration is optional in 2.16 and is only required prior to migration to 3.0.

Luca Milanesio

unread,
Dec 4, 2018, 3:24:16 AM12/4/18
to David Ostrovsky, Luca Milanesio, Repo and Gerrit Discussion
Migration, yes. But I thought that the init of a new site would have been with NoteDb by default :-O

Luca.

Luca Milanesio

unread,
Dec 4, 2018, 4:28:57 AM12/4/18
to David Ostrovsky, Luca Milanesio, Repo and Gerrit Discussion

On 4 Dec 2018, at 08:24, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 4 Dec 2018, at 07:24, David Ostrovsky <david.o...@gmail.com> wrote:


On Tuesday, December 4, 2018 at 7:59:10 AM UTC+1, lucamilanesio wrote:


Sent from my iPhone

On 4 Dec 2018, at 03:24, Hugo Arès <hug...@gmail.com> wrote:

Gerrit 2.16 is broken for a new site with postgres, I fixed it in https://gerrit-review.googlesource.com/c/gerrit/+/206170

Once this is merged, either you build latest stable-2.16 branch or wait for release of 2.16.1

Hugo

On Monday, December 3, 2018 at 2:18:27 AM UTC-5, Kevin Navero wrote:
I'm running into the same thing after gerrit init gets passed plugin installation. My environment is Windows 7, postgresql 11.0, gerrit-2.16. I'm going to try another version of gerrit or postgres and see if that makes any difference. Has anyone found a solution for this yet?

What is the purpose of using PostgreSQL with NoteDB and Gerrit 2.16?

NoteDb migration is optional in 2.16 and is only required prior to migration to 3.0.

Migration, yes. But I thought that the init of a new site would have been with NoteDb by default :-O

Just tried now ... default is still ReviewDb in Gerrit v2.16, which doesn't sound right :-(
Why would one chose ReviewDb for a brand-new setup on Gerrit v2.16?

Luca.

Luca Milanesio

unread,
Dec 4, 2018, 6:07:20 AM12/4/18
to David Ostrovsky, Luca Milanesio, Repo and Gerrit Discussion

On 4 Dec 2018, at 09:28, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 4 Dec 2018, at 08:24, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 4 Dec 2018, at 07:24, David Ostrovsky <david.o...@gmail.com> wrote:


On Tuesday, December 4, 2018 at 7:59:10 AM UTC+1, lucamilanesio wrote:


Sent from my iPhone

On 4 Dec 2018, at 03:24, Hugo Arès <hug...@gmail.com> wrote:

Gerrit 2.16 is broken for a new site with postgres, I fixed it in https://gerrit-review.googlesource.com/c/gerrit/+/206170

Once this is merged, either you build latest stable-2.16 branch or wait for release of 2.16.1

Hugo

On Monday, December 3, 2018 at 2:18:27 AM UTC-5, Kevin Navero wrote:
I'm running into the same thing after gerrit init gets passed plugin installation. My environment is Windows 7, postgresql 11.0, gerrit-2.16. I'm going to try another version of gerrit or postgres and see if that makes any difference. Has anyone found a solution for this yet?

What is the purpose of using PostgreSQL with NoteDB and Gerrit 2.16?

NoteDb migration is optional in 2.16 and is only required prior to migration to 3.0.

Migration, yes. But I thought that the init of a new site would have been with NoteDb by default :-O

Just tried now ... default is still ReviewDb in Gerrit v2.16, which doesn't sound right :-(
Why would one chose ReviewDb for a brand-new setup on Gerrit v2.16?

Because 2.16 is out already, then it is too late to change the defaults, why don't we include an explicit question during init?

Example:
Storage backend? [notedb|reviewdb]

Then it is up to the user to decided if they want to stick to reviewdb and, only in that case, give the option to use PostgreSQL.
For NoteDb, the only DB that makes sense to me for 1 table, 1 row, 1 column, readonly ... is H2 :-)

Luca.

thomasmu...@yahoo.com

unread,
Dec 4, 2018, 1:22:06 PM12/4/18
to Repo and Gerrit Discussion
Luca, how would one convert to using h2 (if they have already migrated to NoteDB and use mysql)? Since i would like to unblock the WMF gerrit slave that's been broken for a few years as it cannot connect to mysql servers in codfw.

thomasmu...@yahoo.com

unread,
Dec 4, 2018, 2:03:41 PM12/4/18
to Repo and Gerrit Discussion
Also noticed by our ops team is "On the flip side, H2 is not the recommended option for large corporate installations. "


Which is putting them off doing this at the WMF (in 2.16)
Reply all
Reply to author
Forward
0 new messages