I just upgraded Gerrit from 2.13.9 to 2.14.3, and I thought I'd try doing an online index update, rather than the offline reindex as normal.However, it didn't work. What did I do wrong?# Upgrade, taking the default answers to every promptjava -jar gerrit-2.14.3.war init -d ${site_path}/ --delete-caches --no-auto-startThat works ok, and the database schema is updated.# I see this message, which tells me I need to do an offline reindex:The index must be rebuilt before starting Gerrit:java -jar gerrit.war reindex -d site_path# Let's ignore that, it must be an old message, online reindex is the modern way, right?# Start Gerrit. It fails to start, and in error_log I see:[2017-09-05 19:03:49,035] [Reindex v32-v39] INFO com.google.gerrit.server.index.OnlineReindexer : Starting online reindex from schema version 32 to 39[2017-09-05 19:03:49,042] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemoncom.google.inject.ProvisionException: Unable to provision, see the following errors:1) No index versions ready; run java -jar /mnt/gerrit/prod/gerrit/bin/gerrit.war reindex
1 errorat com.google.gerrit.server.index.AbstractVersionManager.initIndex(AbstractVersionManager.java:145)at com.google.gerrit.server.index.AbstractVersionManager.start(AbstractVersionManager.java:76)at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:92)at com.google.gerrit.pgm.Daemon.start(Daemon.java:323)at com.google.gerrit.pgm.Daemon.run(Daemon.java:232)at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:204)at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:108)at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:63)at Main.main(Main.java:24)# So I do an offline reindex, and after that Gerrit starts okjava -jar ${site_path}/bin/gerrit.war reindex --threads 20 -d ${site_path}Matthew
--
--
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.
On Wed, Sep 6, 2017 at 3:15 PM, Matthew Webber <mat...@unsolvable.org> wrote:I just upgraded Gerrit from 2.13.9 to 2.14.3, and I thought I'd try doing an online index update, rather than the offline reindex as normal.However, it didn't work. What did I do wrong?# Upgrade, taking the default answers to every promptjava -jar gerrit-2.14.3.war init -d ${site_path}/ --delete-caches --no-auto-startThat works ok, and the database schema is updated.# I see this message, which tells me I need to do an offline reindex:The index must be rebuilt before starting Gerrit:java -jar gerrit.war reindex -d site_path# Let's ignore that, it must be an old message, online reindex is the modern way, right?# Start Gerrit. It fails to start, and in error_log I see:[2017-09-05 19:03:49,035] [Reindex v32-v39] INFO com.google.gerrit.server.index.OnlineReindexer : Starting online reindex from schema version 32 to 39[2017-09-05 19:03:49,042] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemoncom.google.inject.ProvisionException: Unable to provision, see the following errors:1) No index versions ready; run java -jar /mnt/gerrit/prod/gerrit/bin/gerrit.war reindexMy guess is that your previous upgrade (to 2.13.x) didn't successfully finish reindexing to the v32 index version.Obviously, 2.14 requires at least v32 to be ready (to serve searches until online reindexing to v39 is in progress) but it doesn't find one.You can verify my assumption by looking inside: $SITE/index/gerrit_index.config.What is the status of the changes index version 32? I guess it is "ready = false".
>> Other than that, your hypothesis is reasonable, I just don't know of a way to check one way or the other what happened unless Matthew has a full backup of the site dir prior to reindexingLuckily, I do! (Not luck actually, I'm just careful about that kind of thing).Here's what it looked like before the upgrade[index "25"][index "changes_0025"]ready = true[index "accounts_0003"]ready = true[index "changes_0032"]ready = true
I just upgraded Gerrit from 2.13.9 to 2.14.3, and I thought I'd try doing an online index update, rather than the offline reindex as normal.However, it didn't work. What did I do wrong?# Upgrade, taking the default answers to every promptjava -jar gerrit-2.14.3.war init -d ${site_path}/ --delete-caches --no-auto-startThat works ok, and the database schema is updated.# I see this message, which tells me I need to do an offline reindex:The index must be rebuilt before starting Gerrit:java -jar gerrit.war reindex -d site_path# Let's ignore that, it must be an old message, online reindex is the modern way, right?
java -jar gerrit-war.war init -d /your/review-sitejava -jar gerrit-war.war reindex --index groups -d /your/review-site
-start gerrit and online reindex should be started for accounts and changes indexes
Online reindex is only possible if there is a previous version of an index. In Gerrit 2.14, there are 3 indexes:
changes, accounts and groups. Groups index was introduced in 2.14 so that one must be reindexed offline.
The init message is not precise enough, it does not tell you which index absolutely need to be reindexed offline.
To upgrade from 2.13 to 2.14 and use the online reindex for accounts and changes:
-java -jar gerrit-war.war init -d /your/review-site
-java -jar gerrit-war.war reindex --index groups -d /your/review-site
-start gerrit and online reindex should be started for accounts and changes indexes