> I'm following the offline upgrade steps now, but I keep receiving the same InvalidServerIdException errors.
> My site_path is /var/gerrit, and the steps I followed were:
>
> • Stop Gerrit-3.10
> • Download Gerrit-3.12-0-rc4.war
> • Backup folders
> • Move Gerrit-3.12-0-rc4.war to /var/gerrit/bin
> • Run init: java -jar Gerrit-3.12-0-rc4.war init -d /var/gerrit --batch
> • Run Reindex: java -jar Gerrit-3.12-0-rc4.war reindex -d /var/gerrit, which threw the error below:
> [2025-05-02 12:16:24,362] [Index-Batch-127[Index changes slice 10/52 of project eit/project/test5][eit/project/test5-10]] WARN com.google.gerrit.server.index.change.AllChangesIndexer : Failed to read change 172910 for indexing
> com.google.gerrit.server.notedb.InvalidServerIdException: invalid server id, expected b36d7cad-dd42-4c16-9552-f6090c9c46c2: actual: a90c279c-648d-4cb3-b0a6-b8fe2f0b392e
>
> This was my gerrit.config file when I ran the init and reindex commands:
> [gerrit]
> basePath = git
> canonicalWebUrl =
https://gerrit.test.com/
> serverId = b36d7cad-dd42-4c16-9552-f6090c9c46c2
>
> [index]
> type = LUCENE
The serverId you have *now* is b36d7cad-dd42-4c16-9552-f6090c9c46c2, however, the change ‘172910’ of the project `eit/project/test5` was created when the serverId was a90c279c-648d-4cb3-b0a6-b8fe2f0b392e.
That means that *someone* has amended in the past the serverId and created this inconsistency.
The problem *IS NOT* the upgrade process, but that operation that happened in the past and created this inconsistency on the change ‘172910’ of the project `eit/project/test5`.
> After this error, I also tried to modify the serverId value to a90c279c-648d-4cb3-b0a6-b8fe2f0b392e and run the reindex command again, which also threw the error:
> [2025-05-02 12:51:39,335] [Index-Batch-190[Index changes slice 14/65 of project eit/project/test][eit/project/test-14]] WARN com.google.gerrit.server.index.change.AllChangesIndexer : Failed to read change 104404 for indexing
> com.google.gerrit.server.notedb.InvalidServerIdException: invalid server id, expected a90c279c-648d-4cb3-b0a6-b8fe2f0b392e: actual: b36d7cad-dd42-4c16-9552-f6090c9c46c2
Ah, that’s the mistake you've made: it isn’t that the upgrade process has changed the serverId, but you’ve modified it manually when trying to fix the above inconsistency.
There is nothing you can do in the Gerrit’s serverId: if you care about the change ‘172910’ of the project `eit/project/test5` you have to rewrite its history in the /meta ref and amend that serverId.
> I keep getting this loop of invalid serverIds errors, when my serverId is b36d7cad-dd42-4c16-9552-f6090c9c46c2, the error says the value should be a90c279c-648d-4cb3-b0a6-b8fe2f0b392e and vice versa.
Because you have changes in the repository with a mix of serverIds: that’s not a situation that you’ve created now with the upgrade but possibly was done in the past and now comes up because of the offline reindex process.
> I'm lost :( Is there any other step I should do to run the offline reindex?
The offline reindex is fine, you’re not doing anythign wrong.
The data you have is inconsistent, that’s the issue.
You *could* use a hack to fix the situation: importedServerId (see [1]).
Adding b36d7cad-dd42-4c16-9552-f6090c9c46c2 as importedServerId in your gerrit.config, you can “pretend” that the change was coming from another Gerrit server and the error should disappear.
NOTE: This is a hack, you should understand why the serverId was different when that change was created.
HTH
Luca.
[1]
https://www.gerritcodereview.com/3.7.html#import-projects-changes-from-other-gerrit-servers
> To view this discussion visit
https://groups.google.com/d/msgid/repo-discuss/22641eb2-0e5d-416a-9d1c-fc3f466f5d5cn%40googlegroups.com.