java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet

593 views
Skip to first unread message

Stan Rosenberg

unread,
Dec 14, 2015, 4:08:03 PM12/14/15
to Repo and Gerrit Discussion
Hi,

We've seen a rather strange error in gerrit 2.10.2 which doesn't seem to have been previously reported.  A developer accidentally pushed into 'develop' branch rather than 'refs/for/develop'.
He got back an Internal Error message from the git client: Caused by: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;

However, the commit was actually accepted despite the fact that he has no permission to push directly to 'develop'.  I logged into the gerrit server, and here is the stack trace from the error_log.
Any suggestions?

[2015-12-14 17:25:19,618] WARN  com.google.gerrit.server.git.AsyncReceiveCommits : Error in ReceiveCommits while processing changes for project platform
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:202)
        at com.google.gerrit.server.git.WorkQueue$Task.get(WorkQueue.java:346)
        at com.google.gerrit.server.git.MultiProgressMonitor.waitFor(MultiProgressMonitor.java:252)
        at com.google.gerrit.server.git.AsyncReceiveCommits.onPreReceive(AsyncReceiveCommits.java:162)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:208)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:161)
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:115)
        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:368)
        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:744)


Thanks,

stan

Saša Živkov

unread,
Dec 17, 2015, 7:13:47 AM12/17/15
to Stan Rosenberg, Repo and Gerrit Discussion
On Mon, Dec 14, 2015 at 10:08 PM, Stan Rosenberg <stan.ro...@gmail.com> wrote:
Hi,

We've seen a rather strange error in gerrit 2.10.2 which doesn't seem to have been previously reported.  A developer accidentally pushed into 'develop' branch rather than 'refs/for/develop'.
He got back an Internal Error message from the git client: Caused by: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;

Such a method really doesn't seem to exist in 2.10.2. 
Are you using stock Gerrit or have you built it on your own?


However, the commit was actually accepted despite the fact that he has no permission to push directly to 'develop'.  I logged into the gerrit server, and here is the stack trace from the error_log.
Any suggestions?
 

Any other related error_log entries? 
What I see in the stack trace down is only the propagation of the error from the thread where
the error occurred to the thread waiting on that thread to finish.


[2015-12-14 17:25:19,618] WARN  com.google.gerrit.server.git.AsyncReceiveCommits : Error in ReceiveCommits while processing changes for project platform
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:202)
        at com.google.gerrit.server.git.WorkQueue$Task.get(WorkQueue.java:346)
        at com.google.gerrit.server.git.MultiProgressMonitor.waitFor(MultiProgressMonitor.java:252)
        at com.google.gerrit.server.git.AsyncReceiveCommits.onPreReceive(AsyncReceiveCommits.java:162)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:208)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:161)
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:115)
        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:368)
        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:744)


Thanks,

stan

--
--
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.

Björn Pedersen

unread,
Dec 17, 2015, 10:13:25 AM12/17/15
to Repo and Gerrit Discussion, stan.ro...@gmail.com


Am Donnerstag, 17. Dezember 2015 13:13:47 UTC+1 schrieb zivkov:


On Mon, Dec 14, 2015 at 10:08 PM, Stan Rosenberg <stan.ro...@gmail.com> wrote:
Hi,

We've seen a rather strange error in gerrit 2.10.2 which doesn't seem to have been previously reported.  A developer accidentally pushed into 'develop' branch rather than 'refs/for/develop'.
He got back an Internal Error message from the git client: Caused by: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;

Such a method really doesn't seem to exist in 2.10.2.


Really?  This signature has been introduced by  https://gerrit-review.googlesource.com/#/c/53381/ and should be in 2.10 as well (see included in)

Björn

Stan Rosenberg

unread,
Dec 19, 2015, 3:24:12 PM12/19/15
to Repo and Gerrit Discussion, stan.ro...@gmail.com
On Thursday, December 17, 2015 at 7:13:47 AM UTC-5, zivkov wrote:


On Mon, Dec 14, 2015 at 10:08 PM, Stan Rosenberg <stan.ro...@gmail.com> wrote:
Hi,

We've seen a rather strange error in gerrit 2.10.2 which doesn't seem to have been previously reported.  A developer accidentally pushed into 'develop' branch rather than 'refs/for/develop'.
He got back an Internal Error message from the git client: Caused by: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;

Such a method really doesn't seem to exist in 2.10.2. 
Are you using stock Gerrit or have you built it on your own?


I am using stock Gerrit 2.10.2 (unmodified).
 

However, the commit was actually accepted despite the fact that he has no permission to push directly to 'develop'.  I logged into the gerrit server, and here is the stack trace from the error_log.
Any suggestions?
 

Any other related error_log entries? 
What I see in the stack trace down is only the propagation of the error from the thread where
the error occurred to the thread waiting on that thread to finish.

Here is the entire stack trace from error_log including MultiProgressMonitor warning which has the same timestamp but might be unrelated,

[2015-12-14 17:25:19,618] WARN  com.google.gerrit.server.git.MultiProgressMonitor : MultiProgressMonitor worker did not call end() before returning
[2015-12-14 17:25:19,618] WARN  com.google.gerrit.server.git.AsyncReceiveCommits : Error in ReceiveCommits while processing changes for project platform
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:202)
        at com.google.gerrit.server.git.WorkQueue$Task.get(WorkQueue.java:346)
        at com.google.gerrit.server.git.MultiProgressMonitor.waitFor(MultiProgressMonitor.java:252)
        at com.google.gerrit.server.git.AsyncReceiveCommits.onPreReceive(AsyncReceiveCommits.java:162)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:208)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:161)
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:115)
        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:368)
        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:744)
Caused by: java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createCodeReviewNote(CreateReviewNotes.java:277)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createCodeReviewNote(CreateReviewNotes.java:265)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createNoteContent(CreateReviewNotes.java:232)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createNotes(CreateReviewNotes.java:152)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.createReviewNotes(RefUpdateListener.java:123)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.access$000(RefUpdateListener.java:38)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener$1.run(RefUpdateListener.java:66)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.onGitReferenceUpdated(RefUpdateListener.java:92)
        at com.google.gerrit.server.extensions.events.GitReferenceUpdated.fire(GitReferenceUpdated.java:59)
        at com.google.gerrit.server.git.ReceiveCommits.processCommands(ReceiveCommits.java:641)
        at com.google.gerrit.server.git.AsyncReceiveCommits$Worker.run(AsyncReceiveCommits.java:89)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        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)
        ... 8 more

Stan Rosenberg

unread,
Dec 19, 2015, 3:28:49 PM12/19/15
to Repo and Gerrit Discussion, stan.ro...@gmail.com
By the way, I am seeing similar error messages in the error_log.  This way states that merge failed even though it actually succeeded.  (The change was merged and replicated into github.)

Any idea why NoSuchMethodError keeps re-occurring?

[2015-12-18 22:25:04,645] ERROR com.google.gerrit.server.git.ChangeMergeQueue : Merge attempt for platform,refs/heads/master failed
java.lang.NoSuchMethodError: com.google.gerrit.server.ApprovalsUtil.byPatchSet(Lcom/google/gerrit/reviewdb/server/ReviewDb;Lcom/google/gerrit/server/notedb/ChangeNotes;Lcom/google/gerrit/reviewdb/client/PatchSet$Id;)Ljava/util/List;
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createCodeReviewNote(CreateReviewNotes.java:277)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createCodeReviewNote(CreateReviewNotes.java:265)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createNoteContent(CreateReviewNotes.java:232)
        at com.googlesource.gerrit.plugins.reviewnotes.CreateReviewNotes.createNotes(CreateReviewNotes.java:152)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.createReviewNotes(RefUpdateListener.java:123)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.access$000(RefUpdateListener.java:38)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener$1.run(RefUpdateListener.java:66)
        at com.googlesource.gerrit.plugins.reviewnotes.RefUpdateListener.onGitReferenceUpdated(RefUpdateListener.java:92)
        at com.google.gerrit.server.extensions.events.GitReferenceUpdated.fire(GitReferenceUpdated.java:59)
        at com.google.gerrit.server.extensions.events.GitReferenceUpdated.fire(GitReferenceUpdated.java:48)
        at com.google.gerrit.server.git.MergeOp.fireRefUpdated(MergeOp.java:652)
        at com.google.gerrit.server.git.MergeOp.merge(MergeOp.java:265)
        at com.google.gerrit.server.git.ChangeMergeQueue$2.call(ChangeMergeQueue.java:208)
        at com.google.gerrit.server.git.ChangeMergeQueue$2.call(ChangeMergeQueue.java:205)
        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.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
        at com.google.gerrit.server.git.ChangeMergeQueue.mergeImpl(ChangeMergeQueue.java:205)
        at com.google.gerrit.server.git.ChangeMergeQueue.merge(ChangeMergeQueue.java:123)
        at com.google.gerrit.server.change.Submit.apply(Submit.java:184)
        at com.google.gerrit.server.change.Submit.apply(Submit.java:81)
        at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:304)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:279)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:269)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:180)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
        at com.google.gerrit.pgm.http.jetty.GetUserFilter.doFilter(GetUserFilter.java:76)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:113)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:64)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:57)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
        at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1636)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:564)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:219)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:498)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:98)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:98)
        at org.eclipse.jetty.server.Server.handle(Server.java:461)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:284)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
        at java.lang.Thread.run(Thread.java:744)

David Ostrovsky

unread,
Dec 20, 2015, 3:38:03 AM12/20/15
to Repo and Gerrit Discussion
You missed to upgrade reviewnotes plugin.

Gerrit has a critical bug, leaving the site in corrupted state, that was
fixed in upcoming 2.11.6. This is one of the reasons, that prevent us
from being able to upgrade to 2.11. But the workaround is easy:
always upgrade installed plugins, during gerrit upgrade.

Reply all
Reply to author
Forward
0 new messages