Upgrading Gerrit from 3.4.1 --> 3.8.2

950 views
Skip to first unread message

Clinton Wong

unread,
Oct 17, 2023, 8:06:54 PM10/17/23
to Repo and Gerrit Discussion
My current version of Gerrit is 3.4.1, and I would like to upgrade to 3.8.2.  Based up the posts that I have found, it is recommended to not go directly from 3.4.1 to 3.8.2.  Can I follow this path  (3.4.1 –> 3.5.2 –> 3.6.7 –> 3.7.5 –> 3.8.2), or do I need to include more of the minor releases as well?

Dennis W

unread,
Oct 18, 2023, 5:21:01 AM10/18/23
to Repo and Gerrit Discussion
Hi,

Clinton Wong schrieb am Mittwoch, 18. Oktober 2023 um 02:06:54 UTC+2:
My current version of Gerrit is 3.4.1, and I would like to upgrade to 3.8.2.  Based up the posts that I have found, it is recommended to not go directly from 3.4.1 to 3.8.2.  Can I follow this path  (3.4.1 –> 3.5.2 –> 3.6.7 –> 3.7.5 –> 3.8.2), or do I need to include more of the minor releases as well?

not sure if it is necessary, but in my recent upgrade test I went to the latest 3.4 first, so: 3.4.x -> 3.4.8 -> 3.5.6 -> 3.6.7 -> 3.7.5 -> 3.8.2

Also, pay attention to the "Important notes" section in the release notes[1].
E.g: Gerrit 3.5 drops support for Java 8, so you need Java 11 and before upgrading to 3.6 you need to run the "copy-approvals" command mentioned in the notes, etc.
And as noted for 3.8, you have to reindex all indexes after the upgrade before actually starting Gerrit.

[1]

Nasser Grainawi

unread,
Oct 18, 2023, 11:55:31 AM10/18/23
to Dennis W, Repo and Gerrit Discussion
On Wed, Oct 18, 2023 at 3:21 AM 'Dennis W' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
Hi,

Clinton Wong schrieb am Mittwoch, 18. Oktober 2023 um 02:06:54 UTC+2:
My current version of Gerrit is 3.4.1, and I would like to upgrade to 3.8.2.  Based up the posts that I have found, it is recommended to not go directly from 3.4.1 to 3.8.2.  Can I follow this path  (3.4.1 –> 3.5.2 –> 3.6.7 –> 3.7.5 –> 3.8.2), or do I need to include more of the minor releases as well?

not sure if it is necessary, but in my recent upgrade test I went to the latest 3.4 first, so: 3.4.x -> 3.4.8 -> 3.5.6 -> 3.6.7 -> 3.7.5 -> 3.8.2

Also, pay attention to the "Important notes" section in the release notes[1].
E.g: Gerrit 3.5 drops support for Java 8, so you need Java 11 and before upgrading to 3.6 you need to run the "copy-approvals" command mentioned in the notes, etc.
And as noted for 3.8, you have to reindex all indexes after the upgrade before actually starting Gerrit.

^ yes, these are important. However, you should be fine to simplify the steps a little and do something like this:
3.5.2 init
3.5.2 copy-approvals
3.8.2 init
3.8.2 reindex

It's not necessary to run the intermediate 3.6/3.7 init commands.
 
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/ef59472c-232a-4954-867e-3796f2105d51n%40googlegroups.com.

Clinton Wong

unread,
Oct 20, 2023, 9:25:22 PM10/20/23
to Repo and Gerrit Discussion
When I presented the upgrade path to my manager, he asked about creating a new gerrit server running 3.8.2 and replicate the repos from the 3.4.1 gerrit server to the new server.  Is this a viable option to upgrading the existing server?

Fabio Ponciroli

unread,
Oct 21, 2023, 6:27:54 AM10/21/23
to Clinton Wong, Repo and Gerrit Discussion
Hi,

On Sat, 21 Oct 2023 at 02:25, Clinton Wong <clinto...@samsung.com> wrote:
When I presented the upgrade path to my manager, he asked about creating a new gerrit server running 3.8.2 and replicate the repos from the 3.4.1 gerrit server to the new server.  Is this a viable option to upgrading the existing server?

it is not possible. You will have to go through some intermediary releases and steps, as Nasser pointed out.
For example, the "copy-approval" command must be run before getting to 3.6.X during your upgrade process.  

Clinton Wong

unread,
Dec 19, 2023, 6:46:18 PM12/19/23
to Repo and Gerrit Discussion
I just attempted to run the copy-approvals command after running the init command for upgrading from 3.4.8 --> 3.5.2, and the following error message appeared.
  [2023-12-19 16:59:31,279] [main] INFO  com.google.gerrit.server.plugins.CleanupHandle : Cleaned plugin plugin_singleusergroup_231219_1659_14186437178305515771.jar
  [2023-12-19 16:59:31,279] [main] INFO  com.google.gerrit.server.plugins.CleanupHandle : Cleaned plugin plugin_hooks_231219_1659_533955840930432580.jar
  com.google.gerrit.common.Die: invalid server id, expected c25fe413-e051-4021-a543-9dd6a50616b2: actual: 3ce6091f-6c88-37e8-8c75-72f92ae8dfba
   at com.google.gerrit.pgm.util.AbstractProgram.die(AbstractProgram.java:84)
   at com.google.gerrit.pgm.CopyApprovals.run(CopyApprovals.java:78)
   at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:224)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:120)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:65)
at Main.main(Main.java:28)
Caused by: com.google.gerrit.server.notedb.InvalidServerIdException: invalid server id, expected c25fe413-e051-4021-a543-9dd6a50616b2: actual: 3ce6091f-6c88-37e8-8c75-72f92ae8dfba
at com.google.gerrit.server.notedb.ChangeNotes.onLoad(ChangeNotes.java:685)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:162)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:142)
at com.google.gerrit.server.notedb.ChangeNotes$Factory.createForBatchUpdate(ChangeNotes.java:191)
at com.google.gerrit.server.update.BatchUpdate.newChangeContext(BatchUpdate.java:713)
at com.google.gerrit.server.update.BatchUpdate.executeChangeOps(BatchUpdate.java:668)
at com.google.gerrit.server.update.BatchUpdate.execute(BatchUpdate.java:147)
at com.google.gerrit.server.update.BatchUpdate.execute(BatchUpdate.java:434)
at com.google.gerrit.server.approval.RecursiveApprovalCopier.persist(RecursiveApprovalCopier.java:77)
at com.google.gerrit.server.approval.RecursiveApprovalCopier.persist(RecursiveApprovalCopier.java:61)
at com.google.gerrit.pgm.CopyApprovals.run(CopyApprovals.java:75)
... 9 more

Is the "Invalid server id" message tied to an issue with one of the repos or one of the plugins?
I saw a post by another person that said that they could run the "copy-approvals" on specific repos, but I did not see any documentation about this.  Can I run "copy-approvals" on individual repos?

Thanks

On Wednesday, October 18, 2023 at 8:55:31 AM UTC-7 Nasser Grainawi wrote:

Luca Milanesio

unread,
Dec 19, 2023, 6:51:59 PM12/19/23
to Repo and Gerrit Discussion, Luca Milanesio, Clinton Wong
The error has nothing to do with the copy-approval utility.

You have some changes that have been created on a different server and the repository copied over to this repository.

The Gerrit current server-id is: c25fe413-e051-4021-a543-9dd6a50616b2
The change was created on another Gerrit server with server-id: 3ce6091f-6c88-37e8-8c75-72f92ae8dfba

I saw a post by another person that said that they could run the "copy-approvals" on specific repos, but I did not see any documentation about this.  Can I run "copy-approvals" on individual repos?

Clinton Wong

unread,
Dec 20, 2023, 5:37:36 PM12/20/23
to Repo and Gerrit Discussion
Thank you for your quick response and your suggested reading.  Unfortunately, I must have done something wrong because starting the gerrit service is not enabling the port (29418), so I am getting connection refused when I run "ssh -p 29418 hostname gerrit ...".  The java process is running.  I tried running netstat to see what ports are active, and 29418 was not listed.
The sshd section from my gerrit.config is pretty simple
[sshd]
listenAddress = *:29418
threads = 24
batchThreads = 8
maxConnectionsPerUser = 128

I did find some error messages in the error_log, but I don't think that they are related
[2023-12-20T14:52:56.682-06:00] [main] ERROR com.google.gerrit.pgm.Daemon : Thread main threw exception
com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: com/google/gerrit/server/account/InternalAccountUpdate$Builder
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4941)
        at com.google.inject.internal.FailableCache.get(FailableCache.java:54)
        at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
        at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:148)
        at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:592)
        at com.google.inject.internal.AbstractBindingProcessor$Processor.initializeBinding(AbstractBindingProcessor.java:176)
        at com.google.inject.internal.AbstractBindingProcessor$Processor.lambda$scheduleInitialization$0(AbstractBindingProcessor.java:163)
        at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:49)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:126)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
        at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:239)
        at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:244)
        at com.google.gerrit.server.plugins.ServerPlugin.startPlugin(ServerPlugin.java:212)
        at com.google.gerrit.server.plugins.ServerPlugin.start(ServerPlugin.java:182)
        at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:512)
        at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:426)
        at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:331)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:95)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:386)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:285)

        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:224)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:120)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:65)
        at Main.main(Main.java:28)
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: com/google/gerrit/server/account/InternalAccountUpdate$Builder

Is there anything related to the upgrade process that could impact gerrit's ability to listen on port 29418?

doug.r...@cirata.com

unread,
Jan 2, 2024, 2:06:04 PM1/2/24
to Repo and Gerrit Discussion
Clinton:

These types of errors are normally due to not having updated the plugins which no longer match the newer version contract.
Sometimes those errors can prevent the server from starting.  I suggest you update all of your plugins to match your new version and only then try to restart.

Cheers.

Doug

Clinton Wong

unread,
Jan 12, 2024, 1:21:29 PM1/12/24
to Repo and Gerrit Discussion
For each incremental upgrade, do I need to upgrade the plugins and start gerrit in order to validate the upgrade, or can I just execute the init for each upgrade, copy-approvals (where needed) and reindex (after the final upgrade init)?
Reply all
Reply to author
Forward
0 new messages