How to remove changes imported from other gerrit server?

235 views
Skip to first unread message

Yingchun Li

unread,
Sep 18, 2023, 5:28:58 AM9/18/23
to Repo and Gerrit Discussion
Hi,
     I git clone --mirror one repository, and the repository managed by gerrit sever
too, there are a lot of changes with the repo, so I want to remove all of these
changes. is there a command or some good method?
     Because some of my user enconter ''internal error" when pushing the
change to my own server, and I check the server side error-log, and it says:

[2023-09-18T14:49:17.468+08:00] [SSH git-receive-pack /linux/trusted-firmware-a (wenchentan)] WARN  com.google.gerrit.server.git.MultiProgressMonitor : MultiProgressMonitor worker did not call end() before returning
[2023-09-18T14:49:17.469+08:00] [SSH git-receive-pack /linux/trusted-firmware-a (wenchentan)] ERROR com.google.gerrit.server.git.receive.AsyncReceiveCommits : error while processing push
java.util.concurrent.ExecutionException: com.google.gerrit.server.notedb.InvalidServerIdException: invalid server id, expected ff400fd9-08c1-4584-8067-a5a1dc52885d: actual: 8f6f209b-db1a-4cbf-aa44-c8bc30e9bfda
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at com.google.gerrit.server.git.receive.AsyncReceiveCommits.preReceive(AsyncReceiveCommits.java:407)
at com.google.gerrit.server.git.receive.AsyncReceiveCommits.lambda$asHook$0(AsyncReceiveCommits.java:351)
at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:2268)
at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:2182)
at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:98)
at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:109)
at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:74)
at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:492)
at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:113)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:612)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.gerrit.server.notedb.InvalidServerIdException: invalid server id, expected ff400fd9-08c1-4584-8067-a5a1dc52885d: actual: 8f6f209b-db1a-4cbf-aa44-c8bc30e9bfda
at com.google.gerrit.server.notedb.ChangeNotes.onLoad(ChangeNotes.java:685)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:167)
at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:147)
at com.google.gerrit.server.notedb.ChangeNotes$Factory.createForBatchUpdate(ChangeNotes.java:198)
at com.google.gerrit.server.update.BatchUpdate.newChangeContext(BatchUpdate.java:754)
at com.google.gerrit.server.update.BatchUpdate.executeChangeOps(BatchUpdate.java:709)
at com.google.gerrit.server.update.BatchUpdate.execute(BatchUpdate.java:152)
at com.google.gerrit.server.update.BatchUpdate.execute(BatchUpdate.java:453)
at com.google.gerrit.server.git.receive.ReceiveCommits.insertChangesAndPatchSets(ReceiveCommits.java:1126)
at com.google.gerrit.server.git.receive.ReceiveCommits.insertChangesAndPatchSets(ReceiveCommits.java:1032)
at com.google.gerrit.server.git.receive.ReceiveCommits.processCommandsUnsafe(ReceiveCommits.java:798)
at com.google.gerrit.server.git.receive.ReceiveCommits.processCommands(ReceiveCommits.java:684)
at com.google.gerrit.server.git.receive.AsyncReceiveCommits.lambda$preReceive$2(AsyncReceiveCommits.java:386)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at com.google.gerrit.server.util.RequestScopePropagator.lambda$cleanup$1(RequestScopePropagator.java:186)
at com.google.gerrit.server.util.RequestScopePropagator.lambda$context$0(RequestScopePropagator.java:174)
at com.google.gerrit.server.util.ThreadLocalRequestScopePropagator.lambda$wrapImpl$0(ThreadLocalRequestScopePropagator.java:45)
at com.google.gerrit.server.util.RequestScopePropagator$1.call(RequestScopePropagator.java:85)
at com.google.gerrit.server.util.RequestScopePropagator$2.run(RequestScopePropagator.java:116)
... 8 more

ff400fd9-08c1 is my serverId, and 8f6f209b-db1a is my upstream servierId, I don't know
why the change messed with these two serverId(maybe there is a same change num in the upsteam server?)

But anyway, I want to remove all the changes belong to the upstream server, they makes no sense for me, pls give some advice, thanks!

Br,
Yingchun Li

Nikhil Bhambure

unread,
Dec 19, 2023, 4:36:53 AM12/19/23
to Repo and Gerrit Discussion
Hi,
We are also getting the same error. Did you manage to resolve this issue?

Regards,
Nikhil

Yingchun Li

unread,
Dec 21, 2023, 1:03:54 AM12/21/23
to Repo and Gerrit Discussion
On Tuesday, December 19, 2023 at 5:36:53 PM UTC+8 Nikhil Bhambure wrote:
Hi,
We are also getting the same error. Did you manage to resolve this issue?

I just went into the repo,and opened packed-refs and remove all the lines that include "refs/changes/",
after remove all the __changes__ line, I edited the config file to this:
[remote "origin"]
url = https://xxx/upstream.git
fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
mirror = true
and then I can using 'git fetch' safely.
But later I have another way, maybe that better, like this post


maybe you can  set the "gerrit.importedServerId " as Sven Selberg told, but I never try.
Reply all
Reply to author
Forward
0 new messages