New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Released
Owner: ----
Closed: Jul 2015



Sign in to add a comment

Deleting Draft Patches Causing NPE?

Project Member Reported by dougk....@gmail.com, May 7 2015

Issue description

Affected Version: 2.10.2

What steps will reproduce the problem?
Unknown, but seems to be related to draft patches being deleted or otherwise not stored properly.  In this particular case, I saw current_patch_set_id was 3 for the change, but the database only showed one patch_set.

What is the expected output? What do you see instead?
Expect no errors; received a few different NPEs and errors depending on the way you looked at it.  If accessing the change, you would see a 400 error on the "conflicts with" query.  My interest was initially brought on by finding:

[2015-05-07 08:05:53,378] WARN  com.google.gerrit.server.change.ChangeJson : Omitting corrupt change 290774 from results
com.google.gwtorm.server.OrmException: missing current patch set for change 290774
	at com.google.gerrit.server.change.ChangeJson.loadPatchSets(ChangeJson.java:770)
	at com.google.gerrit.server.change.ChangeJson.toChangeInfo(ChangeJson.java:301)
	at com.google.gerrit.server.change.ChangeJson.toChangeInfo(ChangeJson.java:248)
	at com.google.gerrit.server.change.ChangeJson.formatList2(ChangeJson.java:231)
	at com.google.gerrit.server.query.change.QueryChanges.query0(QueryChanges.java:172)
	at com.google.gerrit.server.query.change.QueryChanges.query(QueryChanges.java:146)
	at com.google.gerrit.server.query.change.QueryChanges.apply(QueryChanges.java:113)
	at com.google.gerrit.server.query.change.QueryChanges.apply(QueryChanges.java:41)
	at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:306)
	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.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.RequireSslFilter.doFilter(RequireSslFilter.java:68)
	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.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:745)

Attempting a reindex of the change via REST led to:
[2015-05-07 08:25:30,241] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in POST /code-review/a/changes/290774/index
java.lang.NullPointerException
	at com.google.gerrit.server.index.ChangeField.getFileParts(ChangeField.java:220)
	at com.google.gerrit.server.index.ChangeField$14.get(ChangeField.java:235)
	at com.google.gerrit.server.index.ChangeField$14.get(ChangeField.java:231)
	at com.google.gerrit.server.index.Schema$1.apply(Schema.java:107)
	at com.google.gerrit.server.index.Schema$1.apply(Schema.java:102)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at com.google.gerrit.lucene.LuceneChangeIndex.toDocument(LuceneChangeIndex.java:519)
	at com.google.gerrit.lucene.LuceneChangeIndex.replace(LuceneChangeIndex.java:310)
	at com.google.gerrit.server.index.ChangeIndexer.index(ChangeIndexer.java:131)
	at com.google.gerrit.server.index.ChangeIndexer.index(ChangeIndexer.java:142)
	at com.google.gerrit.server.change.Index.apply(Index.java:48)
	at com.google.gerrit.server.change.Index.apply(Index.java:30)
	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.httpd.RequireIdentifiedUserFilter.doFilter(RequireIdentifiedUserFilter.java:55)
	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.RequireSslFilter.doFilter(RequireSslFilter.java:68)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.gerrit.httpd.ProjectDigestFilter.doFilter(ProjectDigestFilter.java:107)
	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.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:745)

A number of other changes had errors along the lines of:
[2015-05-06 18:53:21,347] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in GET /code-review/changes/?q=status:open+is:mergeable+conflicts:288627&O=a
java.lang.NullPointerException

... with no backtrace.

Please provide any additional information below.

I can't prove all these things are related... let alone if they are reproducible.

 

Comment 1 by faktor...@gmail.com, May 22 2015

I got the same exception and now I cannot see my change nor update it in any way. When I try to re-upload my commit, gerrit rejects because there is no new change!

Reproduced:

 * Upload new commit
 * Patch the commit and upload as draft (used git-review -D)
 * Created a second patch, uploaded again as draft
 * Deleted the first draft (now I saw Patch-Set 1 and 3, no mor Patch-Set 2)
 * Deleted second Branch (Patch-Set 3)
 * All is gone.

First related entry in the error log:

[2015-05-22 16:25:49,093] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in DELETE /changes/102/revisions/a60277e7f9e7f0ada7105a9577fc91916328d25f
java.lang.NullPointerException
        at com.google.gerrit.server.patch.PatchSetInfoFactory.get(PatchSetInfoFactory.java:73)
        at com.google.gerrit.server.change.DeleteDraftPatchSet.previousPatchSetInfo(DeleteDraftPatchSet.java:154)
        at com.google.gerrit.server.change.DeleteDraftPatchSet.deleteOrUpdateDraftChange(DeleteDraftPatchSet.java:133)
        at com.google.gerrit.server.change.DeleteDraftPatchSet.apply(DeleteDraftPatchSet.java:92)
        at com.google.gerrit.server.change.DeleteDraftPatchSet.apply(DeleteDraftPatchSet.java:45)
        at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:322)
        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.httpd.GetUserFilter.doFilter(GetUserFilter.java:82)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:73)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:117)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:68)
        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:1652)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)

Status: ChangeUnderReview
https://gerrit-review.googlesource.com/#/c/68799/
Project Member

Comment 3 by edwin.ke...@gmail.com, Jul 1 2015

Labels: FixedIn-2.11.2
Status: Submitted
Status: Released
I have the same issue here

Sign in to add a comment