My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2498: NPE when pushing existing tag to +refs/heads/BRANCH
2 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Mar 2014


Sign in to add a comment
 
Reported by phil.hord, Feb 25, 2014

Affected Version: 2.6.1

I'm not sure if I can reproduce this.  I was pushing several projects' tags to be the new tips of existing branches:

  git submodule foreach 'git push origin +some-tag:refs/heads/BRANCH'

On the last of these (about 12 total) I received this error:

remote: error: internal error while processing changes java.lang.NullPointerException


I tried the push again and it completed without error.

Possibly unrelated, but when I look at the remote, I see a "tag-looking" branch in refs/heads referring to the tag I was pushing:

$ git ls-remote origin |grep -C4 BL/3[.]3
d850069a278d2e3bd1b651564c9283095ad427a6	refs/heads/BRANCH
76152cff3a3904837ccd2bc00c525d2c844cf1d4	refs/heads/BRANCH^{}

$ git ls-remote origin |grep d850069a278d2e3bd1b651564c9283095ad427a6                     
d850069a278d2e3bd1b651564c9283095ad427a6	refs/heads/BRANCH
d850069a278d2e3bd1b651564c9283095ad427a6	refs/tags/some-tag

Maybe I should have dereferenced my tag before pushing it to Gerrit.  I will investigate that with git.  But maybe this is unrelated, too.

Log info from error_log:

[2014-02-25 12:15:27,947] WARN  com.google.gerrit.server.git.MultiProgressMonitor : MultiProgressMonitor worker did not call end() before returning
[2014-02-25 12:15:27,947] WARN  com.google.gerrit.server.git.AsyncReceiveCommits : Error in ReceiveCommits
java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
        at java.util.concurrent.FutureTask.get(FutureTask.java:91)
        at com.google.gerrit.server.git.WorkQueue$Task.get(WorkQueue.java:315)
        at com.google.gerrit.server.git.MultiProgressMonitor.waitFor(MultiProgressMonitor.java:240)
        at com.google.gerrit.server.git.AsyncReceiveCommits.onPreReceive(AsyncReceiveCommits.java:163)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:203)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:160)
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:100)
        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:429)
        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:206)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:337)
        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:662)
Caused by: java.lang.NullPointerException
        at org.eclipse.jgit.util.RawParseUtils.author(RawParseUtils.java:567)
        at org.eclipse.jgit.revwalk.RevCommit.getAuthorIdent(RevCommit.java:348)
        at com.google.gerrit.server.git.SubmoduleOp.updateGitlinks(SubmoduleOp.java:285)
        at com.google.gerrit.server.git.SubmoduleOp.updateSuperProjects(SubmoduleOp.java:244)
        at com.google.gerrit.server.git.SubmoduleOp.update(SubmoduleOp.java:122)
        at com.google.gerrit.server.git.ReceiveCommits.autoCloseChanges(ReceiveCommits.java:2068)
        at com.google.gerrit.server.git.ReceiveCommits.processCommands(ReceiveCommits.java:592)
        at com.google.gerrit.server.git.AsyncReceiveCommits$Worker.run(AsyncReceiveCommits.java:90)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
        at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
        at com.google.gerrit.server.util.ThreadLocalRequestScopePropagator$1.call(ThreadLocalRequestScopePropagator.java:55)
        at com.google.gerrit.server.util.RequestScopePropagator$1.call(RequestScopePropagator.java:98)
        at com.google.gerrit.server.util.RequestScopePropagator$2.run(RequestScopePropagator.java:131)
        ... 9 more

Feb 26, 2014
#1 phil.hord
I am able to reliably reproduce this issue in one repo, but not in others.  I am not able to share this repo publicly.  It is not related to the tag I was pushing before.  It only occurs when using --force and when the --force was really needed.  It does not occur when pushing to a different (new) branch name.

Pushing a previous commit as the new tip of the existing branch produces the error:

  $ git push origin +BRANCH^:refs/heads/BRANCH     # NPE
  $ git push origin +BRANCH:refs/heads/BRANCH      # No error

But the error does not occur on BRANCH^ if I first push an even earlier commit (BRANCH^^) as the tip, thus making the BRANCH^ a FF-push:

  $ git push origin +BRANCH^^:refs/heads/BRANCH    # NPE
  $ git push origin +BRANCH^:refs/heads/BRANCH     # No error
  $ git push origin +BRANCH:refs/heads/BRANCH      # No error

I get no errors reported when pushing to a new branch name:

  $ git push origin +BRANCH:refs/heads/foo         # Create the branch
  $ git push origin +BRANCH^^:refs/heads/foo       # Rewind it -- no error
  $ git push origin +BRANCH^:refs/heads/foo        # No error
  $ git push origin +BRANCH:refs/heads/foo         # No error


$ git push origin +BRANCH^^:refs/heads/BRANCH
Total 0 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 2, done    
remote: error: internal error while processing changes java.lang.NullPointerException
To gerrit:project
 + 37315a0...029d3dc BRANCH^^ -> BRANCH (forced update)

$ git push origin BRANCH:refs/heads/BRANCH
Total 0 (delta 0), reused 0 (delta 0)
remote: Processing changes: closed: 1, refs: 2, done    
To gerrit:project
   029d3dc..37315a0  BRANCH -> BRANCH


The error_log shows the same exception info already reported in this bug.
Feb 26, 2014
#2 phil.hord
Stating the obvious:

Looking at the log closer, I see this is being caused by something in submodule-subscriptions being updated.

        at com.google.gerrit.server.git.SubmoduleOp.updateGitlinks(SubmoduleOp.java:285)
        at com.google.gerrit.server.git.SubmoduleOp.updateSuperProjects(SubmoduleOp.java:244)
Mar 4, 2014
Project Member #3 david.pu...@sonymobile.com
In v2.6.1 line 285 of SubmoduleOp.java is:

  author = c.getAuthorIdent();

c is initialised further up:

  RevCommit c = myRw.parseCommit(me.getValue());


Mar 4, 2014
Project Member #4 david.pu...@sonymobile.com
https://gerrit-review.googlesource.com/#/c/54991/1
Status: ChangeUnderReview
Mar 6, 2014
#5 sop@google.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.8.2
Mar 11, 2014
Project Member #6 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting