My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 652: Null Pointer Exception when failing to merge to a headless (new) branch.
1 person starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Mar 2012


Sign in to add a comment
 
Project Member Reported by mf...@codeaurora.org, Aug 2, 2010
Affected Version:

 v2.1.4-rc1

What steps will reproduce the problem?
1. Deploy a new gerrit installation
2. Create a new project
3. Push patch 1 to the new project
4. Push patch 2 which depends on patch 1 to the new project
5. (verfiy/approve/) Submit patch 2

What is the expected output? What do you see instead?

This submit should fail merging since patch 1 is not yet submitted.  I see the following Null Pointer Exception in the error_log:


ERROR com.google.gerrit.server.git.ChangeMergeQueue : Merge attempt for rc2,refs/heads/master failed
java.lang.NullPointerException
        at org.eclipse.jgit.lib.RefUpdate.setNewObjectId(RefUpdate.java:263)
        at com.google.gerrit.server.git.MergeOp.updateBranch(MergeOp.java:839)
        at com.google.gerrit.server.git.MergeOp.mergeImpl(MergeOp.java:233)
        at com.google.gerrit.server.git.MergeOp.merge(MergeOp.java:203)
        at com.google.gerrit.server.git.ChangeMergeQueue.mergeImpl(ChangeMergeQueue.java:193)
        at com.google.gerrit.server.git.ChangeMergeQueue.access$200(ChangeMergeQueue.java:49)
        at com.google.gerrit.server.git.ChangeMergeQueue$MergeEntry.run(ChangeMergeQueue.java:235)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        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:207)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)


Please provide any additional information below.

If the server is restarted later, the merge will be reattempted and again cause this NPE.

Analysis of MergeOp shows that line 839 is:

   branchUpdate.setNewObjectId(mergeTip);

Testing confirms that mergeTip is null.  This probably makes sense since the branch is likely not yet created in the repo (since patch 1 was not yet submitted.)

Aug 21, 2010
#1 sop@google.com
Whoops.  We were missing a != null test.

Fixed in Ia4112bbb03526d8a75e0eba577c7f5a672bf7298
Status: Fixed
Labels: FixedIn-2.1.5
Mar 27, 2012
#2 sop@google.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting