"invalid server id" error occurs when updating index after upgrade

105 views
Skip to first unread message

Christopher John

unread,
Dec 8, 2023, 3:28:48 AM12/8/23
to Repo and Gerrit Discussion
The original version is gerrit 3.6.3, and I plan to upgrade it to 3.7.1. When I run the java -jar gerrit-3.7.1.war init -d /home/gerrit/ command to enter information as prompted, no error is reported.

But when I update the index by executing "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", Appear error "com. Google. Gerrit. Server. Notedb. InvalidServerIdException: invalid server id, expected e2d7b991-ec1a-4834-becb-6b6240984f40: actual: 24129dfe-e469-43a0-b591-53a522621fc8”
QQ截图20231208161830.png
I also tried to manually change the server id and then re-execute "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", but there was still an error and I could execute "sh gerrit.sh start". The upgrade to gerrit3.7.1 can be seen on the web interface after startup, but the original committed changes are lost. I think it may be caused by failure to update index.

Finally, attach the print when executing these two commands:
1111.txt

Fabio Ponciroli

unread,
Dec 8, 2023, 3:43:32 AM12/8/23
to Christopher John, Repo and Gerrit Discussion
Hi Christopher,

On Fri, 8 Dec 2023 at 09:28, Christopher John <108404...@gmail.com> wrote:
The original version is gerrit 3.6.3, and I plan to upgrade it to 3.7.1. When I run the java -jar gerrit-3.7.1.war init -d /home/gerrit/ command to enter information as prompted, no error is reported.

But when I update the index by executing "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", Appear error "com. Google. Gerrit. Server. Notedb. InvalidServerIdException: invalid server id, expected e2d7b991-ec1a-4834-becb-6b6240984f40: actual: 24129dfe-e469-43a0-b591-53a522621fc8”

Can you try to run the same reindexing command in 3.6 without changing the gerrit.config?
I suspect you should have the same error.

It looks like you have imported some projects from another Gerrit instance. Were the changes the reindex is failing for belonging to projects imported from another Gerrit instance?

Out of curiosity, why are you planning to migrate to 3..7.1 and not the latest 3.7? You could migrate directly to the latest one (currently 3.7.6).

HTH,
Ponch
 
QQ截图20231208161830.png
I also tried to manually change the server id and then re-execute "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", but there was still an error and I could execute "sh gerrit.sh start". The upgrade to gerrit3.7.1 can be seen on the web interface after startup, but the original committed changes are lost. I think it may be caused by failure to update index.

Finally, attach the print when executing these two 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/69e8508b-1d2a-4b56-bf33-1985f6c12f50n%40googlegroups.com.

Matthias Sohn

unread,
Dec 8, 2023, 4:43:55 AM12/8/23
to Christopher John, Repo and Gerrit Discussion
On Fri, Dec 8, 2023 at 9:28 AM Christopher John <108404...@gmail.com> wrote:
The original version is gerrit 3.6.3, and I plan to upgrade it to 3.7.1. When I run the java -jar gerrit-3.7.1.war init -d /home/gerrit/ command to enter information as prompted, no error is reported.

But when I update the index by executing "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", Appear error "com. Google. Gerrit. Server. Notedb. InvalidServerIdException: invalid server id, expected e2d7b991-ec1a-4834-becb-6b6240984f40: actual: 24129dfe-e469-43a0-b591-53a522621fc8”
QQ截图20231208161830.png

Next time paste the stacktrace verbatim as text and not as a screenshot.
 
I also tried to manually change the server id and then re-execute "java -jar gerrit-3.7.1.war reindex -d /home/gerrit/", but there was still an error and I could execute "sh gerrit.sh start". The upgrade to gerrit3.7.1 can be seen on the web interface after startup, but the original committed changes are lost. I think it may be caused by failure to update index.

Finally, attach the print when executing these two commands:

Notedb only accepts changes which have been created in the same Gerrit instance to ensure references
to account metadata which are stored in the All-Users repo can be resolved in the same Gerrit instance.

Did you move repositories from another Gerrit instance or did you maybe modify the serverid in gerrit.config ?

-Matthias

Christopher John

unread,
Dec 8, 2023, 4:53:36 AM12/8/23
to Repo and Gerrit Discussion
Thank you for your reply. How do I clean up Noteb? I have reinstalled and uninstalled gerrit many times in my environment. Could it be that Noteb has a cache that has not been cleared? Is it possible that this is the cause?

Christopher John

unread,
Dec 8, 2023, 4:55:29 AM12/8/23
to Repo and Gerrit Discussion

thank you for your reply. Yes, I imported some projects from another Gerrit instance before, how do I clean them up now?

Sven Selberg

unread,
Dec 8, 2023, 9:34:18 AM12/8/23
to Repo and Gerrit Discussion
On Friday, December 8, 2023 at 10:55:29 AM UTC+1 Christopher John wrote:

thank you for your reply. Yes, I imported some projects from another Gerrit instance before, how do I clean them up now?

I think you just need to set gerrit.importedServerId in gerrit.config to the serverid of the server you copied the changes from and Gerrit should accept them as its own.

Christopher John

unread,
Dec 8, 2023, 8:36:59 PM12/8/23
to Repo and Gerrit Discussion
Thank you for your reply, I tried to modify serverid during restart, boot is able to start normally, but the previously committed changes will be lost
Reply all
Reply to author
Forward
0 new messages