1

I have been researching this issue for few days without luck. I found many posts reporting similar issues but not with Gerrit code review.

The case is that we have a repo which contains many branches. Only one branch (dev) show this problem.

org.eclipse.jgit.errors.MissingObjectException: Missing unknown 5f3190e131541cec4ef7176262eaf4a03c4a4e6c
        at com.google.gerrit.server.git.MergeOp.integrateIntoHistory(MergeOp.java:497)
        at com.google.gerrit.server.git.MergeOp.merge(MergeOp.java:433)
        at com.google.gerrit.server.change.Submit.apply(Submit.java:225)
        at com.google.gerrit.server.change.Submit.apply(Submit.java:83)
        at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:341)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)

To reproduce the error just do a change. Commit and push to gerrit refs/for/dev. Once I click on Submit in Gerrit I get the above error.

The revisions on the server are as follows:

  • Gerrit Code Review (2.13.1)
  • Git-2.1.0
  • Java 1.7.0_71

Running git fsck on the server side return Ok.

Running git show 5f3190e131541cec4ef7176262eaf4a03c4a4e6c returns

fatal: bad object 5f3190e131541cec4ef7176262eaf4a03c4a4e6c

Changing the project preference in Gerrit from Merge if necessary to Rebase if necessary got this exception.

Caused by: com.google.gerrit.server.git.UpdateException: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 5f3190e131541cec4ef7176262eaf4a03c4a4e6c
        at com.google.gerrit.server.git.BatchUpdate.executeUpdateRepo(BatchUpdate.java:673)
        at com.google.gerrit.server.git.BatchUpdate.execute(BatchUpdate.java:400)
        at com.google.gerrit.server.git.MergeOp.integrateIntoHistory(MergeOp.java:478)
        ... 43 more
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 5f3190e131541cec4ef7176262eaf4a03c4a4e6c
        at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
        at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
        at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
        at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
        at com.google.gerrit.server.git.CodeReviewCommit$CodeReviewRevWalk.parseCommit(CodeReviewCommit.java:110)
        at com.google.gerrit.server.git.SubmoduleOp.updateSubmodule(SubmoduleOp.java:461)
        at com.google.gerrit.server.git.SubmoduleOp.composeGitlinksCommit(SubmoduleOp.java:369)
        at com.google.gerrit.server.git.SubmoduleOp$GitlinkOp.updateRepo(SubmoduleOp.java:85)
        at com.google.gerrit.server.git.BatchUpdate.executeUpdateRepo(BatchUpdate.java:661)
        ... 45 more

It is worth mentioning that the hash 5f3190e131541cec4ef7176262eaf4a03c4a4e6c does not show anywhere on the Gerrit code review page (only in the error message). Any new commit will cause this error.

ayakout
  • 49
  • 7
  • Is the 5f3190e131541cec4ef7176262eaf4a03c4a4e6c the SHA showed at the "Commit" field (between "Commiter" and "Parent(s)" fields) in the change screen? Or is there another SHA there? – Marcelo Ávila de Oliveira Jan 16 '17 at 16:33
  • No, it does not show anywhere in the gerrit page. Only in the error message. I have updated the post with this comment as well. – ayakout Jan 16 '17 at 16:45

2 Answers2

1

Looking in Gerrit Bug Tracker show you this issue

Did a push has been force by one developper on that branch ?

You can check this going to gerrit folder installation, then git folder of your project and look for history. I suspect one developer force the push of 5f3190e131541cec4ef7176262eaf4a03c4a4e6c

Flows
  • 3,675
  • 3
  • 28
  • 52
  • I created a new Gerrit project `project-1` and copied the contents of the problematic `project.git` to `project-1.git`. After that I checked out the `dev` branch and was able to deliver a change and merge it without issues. [The issue](https://bugs.chromium.org/p/gerrit/issues/detail?id=5194&can=1&q=org.eclipse.jgit.errors.MissingObjectException%3A&colspec=ID%20Type%20Stars%20Milestone%20Status%20Priority%20Owner%20Summary) you mentioned seems to report very similar issue, the difference is that in my project there are no submodules. – ayakout Jan 17 '17 at 16:50
0

Gerrit index seems to be the cause of this error. The index points to non existing object, even rebuilding the index did not solve this issue.

Searching all git objects did not find any matches. I used the method described here.

I think my problem is connected to this bug report here

Possible solutions to consider is to create a new branch since this problem was seen only on a specific branch. I would also tag and delete the problematic branch since its not usable anymore.

Deleting the Project in Gerrit and recreating it seems to work (if its easy to do so) but the delete-project plugin has some limitations regarding submodules subscriptions.

Doing manual delete of the repo.git on disk followed by flushing Gerrit cache would indeed remove the project however Gerrit will not allow the creation of another project with the same name.

Community
  • 1
  • 1
ayakout
  • 49
  • 7