************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC. *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS! *****
************************************************************
Affected Version:
2.7
What steps will reproduce the problem?
1. push several changes to a branch force-push other changes to the branch (changing the progression, reflog will now reference sha1:s no loger part of the branch)
2. git gc && git prune (the sha1:s that the reflog pointed to are now gone)
3. gerrit gc -> failed (since it can't find the data that is referenced in the reflog)
What is the expected output? What do you see instead?
I fully expect that gerrit should ignore reflog or treat it as a warning
(just like git does)
Please provide any additional information below.
Editing the reflogs or removing them eventually led to gerrit gc wroking
Stacktrace:
org.eclipse.jgit.api.errors.JGitInternalException: Garbage collection failed.
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:126)
at com.google.gerrit.server.git.GarbageCollection.run(GarbageCollection.java:86)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand.runGC(GarbageCollectionCommand.java:97)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand.access$500(GarbageCollectionCommand.java:41)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand$1.run(GarbageCollectionCommand.java:67)
at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:429)
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:337)
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:724)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown <sha1>
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:148)
at org.eclipse.jgit.lib.ObjectReader$1.open(ObjectReader.java:302)
at org.eclipse.jgit.revwalk.RevWalk$2.next(RevWalk.java:921)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1698)
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.internal.storage.file.GC.writePack(GC.java:676)
at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:531)
at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:164)
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:123)
... 13 more
[2013-09-21 13:29:51,887] ERROR com.google.gerrit.server.git.GarbageCollection : [gerrit/otherproject]
org.eclipse.jgit.api.errors.JGitInternalException: Garbage collection failed.
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:126)
at com.google.gerrit.server.git.GarbageCollection.run(GarbageCollection.java:86)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand.runGC(GarbageCollectionCommand.java:97)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand.access$500(GarbageCollectionCommand.java:41)
at com.google.gerrit.sshd.commands.GarbageCollectionCommand$1.run(GarbageCollectionCommand.java:67)
at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:429)
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:337)
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:724)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown <sha1>
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:148)
at org.eclipse.jgit.lib.ObjectReader$1.open(ObjectReader.java:302)
at org.eclipse.jgit.revwalk.RevWalk$2.next(RevWalk.java:921)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1698)
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.internal.storage.file.GC.writePack(GC.java:676)
at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:531)
at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:164)
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:123)
... 13 more