我现在有一个gerrit 2.8.6,我即将推出基于gerrit 2.11的全新基础设施。为了验证新基础架构的功能,我想设置从实时服务器到新服务器的gerrit复制,以便在(新)jenkins中触发作业,并且将并行测试管道的所有其余部分。 / p>
设置复制插件是为了强制推送实时服务器中的所有内容,如下所示:
[remote "dev-infra"]
url = ansible@new.server.fqdn:${name}.git
push = +refs/*:refs/*
在使用repos对文件系统进行rsyncing,迁移数据库以及执行init和reindex之后,我开始了复制,但是它在实时端开始失败并显示这个堆栈跟踪:
[2016-01-07 11:57:01,561] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to ansible@new.server.fqdn:interface/ui.git
org.eclipse.jgit.errors.TransportException: ansible@ew.server.fqdn:interface/ui.git: Missing unknown 77752e00818523aa58fa61d64bdb8c059ab5d00d
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:217)
at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:152)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:165)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1173)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1219)
at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:377)
at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:351)
at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:267)
at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:78)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:240)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:237)
at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 77752e00818523aa58fa61d64bdb8c059ab5d00d
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:148)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:229)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:809)
at org.eclipse.jgit.internal.storage.pack.PackWriterBitmapWalker.findObjects(PackWriterBitmapWalker.java:95)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPackUsingBitmaps(PackWriter.java:1847)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1665)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:797)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:760)
at org.eclipse.jgit.transport.BasePackPushConnection.writePack(BasePackPushConnection.java:300)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:197)
... 23 more
和接收端的相关堆栈跟踪:
[2016-01-07 11:58:02,328] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user Ansible account 999999) during git-receive-pack 'interface/ui.git'
com.google.gerrit.sshd.BaseCommand$Failure: fatal: Unpack error, check server log
at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:176)
at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:101)
at com.google.gerrit.sshd.AbstractGitCommand.access$000(AbstractGitCommand.java:32)
at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:70)
at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:442)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Unpack error on project "interface/ui":
AdvertiseRefsHook: org.eclipse.jgit.transport.AdvertiseRefsHookChain@14c7d35cclass org.eclipse.jgit.transport.AdvertiseRefsHookChain
at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:175)
... 12 more
Caused by: org.eclipse.jgit.errors.UnpackException: Exception while parsing pack stream
at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:239)
at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:160)
at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:115)
... 12 more
Caused by: java.io.EOFException: Packfile is truncated.
at org.eclipse.jgit.transport.PackParser.fill(PackParser.java:1138)
at org.eclipse.jgit.transport.PackParser.readPackHeader(PackParser.java:838)
at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:476)
at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:194)
at org.eclipse.jgit.transport.BaseReceivePack.receivePack(BaseReceivePack.java:1020)
at org.eclipse.jgit.transport.BaseReceivePack.receivePackAndCheckConnectivity(BaseReceivePack.java:848)
at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:191)
... 14 more
missing unknown
是什么意思?如果我尝试使用项目git存储库上的ref执行git show
,我会得到:
# git show 77752e00818523aa58fa61d64bdb8c059ab5d00d
fatal: bad object 77752e00818523aa58fa61d64bdb8c059ab5d00d
导致这种行为的原因是什么?我发现this非常类似的错误报告,但我们使用的版本似乎没有受到影响。
修改
# git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (459889/459889), done.
Checking connectivity: 459546, done.
dangling commit 3771a40494e90d369015e3de06d120c0ad146059
dangling commit 8368c5b1a95466b8b14fd24e45cea5e27b3cf6f9
dangling commit c111e6fca5a917b0ee3cb284cb3873289befd5f8
dangling commit 84a666f2181f4ab2587a4da0f7dc4ade24b4e45a