How to fix git error broken link from commit

1,293 views
Skip to first unread message

suman...@gmail.com

unread,
Apr 5, 2018, 2:36:23 AM4/5/18
to Repo and Gerrit Discussion
 
Hi Team,

we need your help to resolve the broken links from commit to tree ?
and we try to clone the project ,getting the below error once . we already did the git fsck

fatal: internal server error
remote: internal server error
fatal: early EOF
fatal: index-pack failed

Can anyone help on this problem






Luca Milanesio

unread,
Apr 5, 2018, 2:49:42 AM4/5/18
to suman...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion
You had a 500 on Gerrit: the error_log on the server side will tell you what's wrong.

Luca.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

suman...@gmail.com

unread,
Apr 5, 2018, 5:20:17 AM4/5/18
to Repo and Gerrit Discussion

Thanks for the support

we checked the error_log , we did not find any error code :500 ,  error message is broken link from  commit a27ef8 (refs/heads/develop@{1522387485})
              to    tree c1ed4a1ac (refs/heads/develop@{1522387485}:)

Sven Selberg

unread,
Apr 5, 2018, 6:20:23 AM4/5/18
to Repo and Gerrit Discussion
What you will probably find in the error log is a MissingObjectException.

What kind of GC are you doing on the repositories and which Gerrit version are you using?
What does git fsck on the repo server side show?

If you prune the repos and are running a Gerrit version <=v2.13 it could be this bug https://bugs.chromium.org/p/gerrit/issues/detail?id=6965

BR
Sven Selberg

Luca Milanesio

unread,
Apr 5, 2018, 6:30:04 AM4/5/18
to Sven Selberg, Martin Fick, Luca Milanesio, Repo and Gerrit Discussion, Dave Borowitz

On 5 Apr 2018, at 11:20, Sven Selberg <sven.s...@axis.com> wrote:

What you will probably find in the error log is a MissingObjectException.

What kind of GC are you doing on the repositories and which Gerrit version are you using?
What does git fsck on the repo server side show?

If you prune the repos and are running a Gerrit version <=v2.13 it could be this bug https://bugs.chromium.org/p/gerrit/issues/detail?id=6965

Thanks for the pointer, very interesting analysis.
I believe the solution implemented by Dave is a good one. However, the problem highlights other issues in JGit cache invalidation I believe.

Even if a loose object is cached in memory, JGit cannot rely on it without checking the last access time on the filesystem.
Is there an underlying JGit issue still opened then?

I would be curious if this is one of the fixes that Qualcomm (@Martin) did on their JGit version in prod :-)

Luca.


BR
Sven Selberg


On Thursday, April 5, 2018 at 11:20:17 AM UTC+2, suman...@gmail.com wrote:

Thanks for the support

we checked the error_log , we did not find any error code :500 ,  error message is broken link from  commit a27ef8 (refs/heads/develop@{1522387485})
              to    tree c1ed4a1ac (refs/heads/develop@{1522387485}:)




On Thursday, April 5, 2018 at 12:06:23 PM UTC+5:30, suman...@gmail.com wrote:
 
Hi Team,

we need your help to resolve the broken links from commit to tree ?
and we try to clone the project ,getting the below error once . we already did the git fsck

fatal: internal server error
remote: internal server error
fatal: early EOF
fatal: index-pack failed

Can anyone help on this problem







suman...@gmail.com

unread,
Apr 5, 2018, 6:56:45 AM4/5/18
to Repo and Gerrit Discussion

Hi,

we are using git version :2.10.4
we used the following GC comand: git gc --prune=now.

error_log message:

org.eclipse.jgit.transport.UploadPackInternalServerErrorException
    at org.eclipse.jgit.transport.UploadPack.sendPack(UploadPack.java:1311)
    at org.eclipse.jgit.transport.UploadPack.service(UploadPack.java:719)
    at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:630)
    at com.google.gerrit.sshd.commands.Upload.runImpl(Upload.java:80)
    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:370)
    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:745)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing tree c1ed4a1ac128a079e16c6d6d5c521abf5b5d26e2
    at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:145)
    at org.eclipse.jgit.revwalk.ObjectWalk.newTreeVisit(ObjectWalk.java:727)
    at org.eclipse.jgit.revwalk.ObjectWalk.nextObject(ObjectWalk.java:378)
    at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1842)
    at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:799)
    at org.eclipse.jgit.transport.UploadPack.sendPack(UploadPack.java:1420)
    at org.eclipse.jgit.transport.UploadPack.sendPack(UploadPack.java:1305)
    ... 15 more









On Thursday, April 5, 2018 at 12:06:23 PM UTC+5:30, suman...@gmail.com wrote:

Luca Milanesio

unread,
Apr 5, 2018, 6:59:11 AM4/5/18
to suman...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion

On 5 Apr 2018, at 11:56, suman...@gmail.com wrote:


Hi,

we are using git version :2.10.4

You mean, Gerrit 2.10.4
If git fsck worked fine *and* a "git show c1ed4a1ac128a079e16c6d6d5c521abf5b5d26e2" says that the object is there and is a valid tree, then just restart Gerrit because the JGit cache is stale.









On Thursday, April 5, 2018 at 12:06:23 PM UTC+5:30, suman...@gmail.com wrote:
 
Hi Team,

we need your help to resolve the broken links from commit to tree ?
and we try to clone the project ,getting the below error once . we already did the git fsck

fatal: internal server error
remote: internal server error
fatal: early EOF
fatal: index-pack failed

Can anyone help on this problem







Sven Selberg

unread,
Apr 5, 2018, 7:32:41 AM4/5/18
to Repo and Gerrit Discussion
I you mean Gerrit 2.10.4 and gc with prune=now then I would guess that there's a high probability that you are hit by the bug I linked.
Then git fsck will warn about missing tree.

If it is I fixed it by some Git surgery if you are fairly familiar with git you:
1. Check the commit object with the missing tree, it should be a merge commit.
2. Redo the merge between it's parents on some random branch. This should create the missing objects in the git repo.
3. Verify with git fsck.

I would recommend doing this in a copy of the repo first or copy the repo to a backup location first.

BR
Sven Selberg

Sven Selberg

unread,
Apr 5, 2018, 7:33:39 AM4/5/18
to Repo and Gerrit Discussion
@Luca
I don't remember ever filing the bug to JGit and I cannot find an issue about it.

Luca Milanesio

unread,
Apr 5, 2018, 7:38:36 AM4/5/18
to Sven Selberg, Martin Fick, Luca Milanesio, Repo and Gerrit Discussion
Don't know if an issue was tracked on JGit. 
Martin mentioned many fixes they did on their JGit fork, but I am unsure they were all tracked.

Luca.

On 5 Apr 2018, at 12:33, Sven Selberg <sven.s...@axis.com> wrote:

@Luca
I don't remember ever filing the bug to JGit and I cannot find an issue about it.

Reply all
Reply to author
Forward
0 new messages