org.eclipse.jgit.errors.MissingObjectException when gc

22 views
Skip to first unread message

Ping Yin

unread,
Aug 13, 2016, 11:02:08 PM8/13/16
to repo-discuss
When triggering gc on the review site, the gc_log gives the following error

Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing
unknown 31e8b19a1bfec84d1c7b8afbdcec152f0c160914
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:145)
at org.eclipse.jgit.lib.ObjectReader$1.open(ObjectReader.java:299)
at org.eclipse.jgit.revwalk.RevWalk$2.next(RevWalk.java:971)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1667)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:759)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:722)
at org.eclipse.jgit.internal.storage.file.GC.writePack(GC.java:713)
at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:568)
at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:169)
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:175)


By

select * from patch_sets where
revision='31e8b19a1bfec84d1c7b8afbdcec152f0c160914';

I got the change_id 137502, then delete all references to the change from db

delete from account_patch_reviews where change_id=137502;
delete from patch_set_approvals where change_id=137502;
delete from patch_comments where change_id=137502;
delete from patch_sets where change_id=137502;
delete from starred_changes where change_id=137502;
delete from change_messages where change_id=137502;
delete from changes where change_id=137502;


Then retrigger gc, the error still happens.

What to do next?

Ping Yin

Ping Yin

unread,
Aug 13, 2016, 11:20:16 PM8/13/16
to repo-discuss
When running gc in the command line, it errors out
"refs/changes/02/137502/3 does not point to a valid object!", since i
deleted all the reference from db.
how to resolve this error?

$ git gc
error: refs/changes/02/137502/3 does not point to a valid object!
Counting objects: 448142, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (97010/97010), done.
Writing objects: 100% (448142/448142), done.
Total 448142 (delta 347742), reused 448142 (delta 347742)
error: refs/changes/02/137502/3 does not point to a valid object!
error: refs/changes/02/137502/3 does not point to a valid object!
Checking connectivity: 448142, done.
Ping Yin

Ping Yin

unread,
Aug 13, 2016, 11:23:17 PM8/13/16
to repo-discuss
will it work to execute 'rm -rf refs/changes/02/137502'?
Ping Yin
Reply all
Reply to author
Forward
0 new messages