Solr
  1. Solr
  2. SOLR-6626

NPE in FieldMutatingUpdateProcessor when indexing a doc with null field value

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.9
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      NullPointerException when indexing a JSON doc with null field.
      1. run the example-schemaless
      2. visit http://localhost:8983/solr/#/collection1/documents
      3. put a doc

      { "id":"fooop" }

      and it succeeds
      4. put a doc

      { "id":"fooop", "exampleField":null }

      and NPE is result.

      This could be considered a regression of SOLR-2714 which was resolved in v3.6, but the error occurs when the null-containing doc is added instead of during parsing.

      Stacktrace:

      ERROR org.apache.solr.servlet.SolrDispatchFilter – null:java.lang.NullPointerException
      at org.apache.solr.update.processor.FieldValueMutatingUpdateProcessor.mutate(FieldValueMutatingUpdateProcessor.java:65)
      at org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:97)
      at org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:51)
      at org.apache.solr.update.processor.DistributedUpdateProcessor.doLocalAdd(DistributedUpdateProcessor.java:867)
      at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:1021)
      at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:690)
      at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:100)
      at org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:51)
      at org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory$DefaultValueUpdateProcessor.processAdd(AbstractDefaultValueUpdateProcessorFactory.java:94)
      at org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.processUpdate(JsonLoader.java:141)
      at org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.load(JsonLoader.java:106)
      at org.apache.solr.handler.loader.JsonLoader.load(JsonLoader.java:68)
      at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:99)
      at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)

        Activity

        Hide
        Jessica Cheng Mallet added a comment -

        We're also seeing this with the javabin codec:

        null:java.lang.NullPointerException
        at org.apache.solr.update.processor.FieldValueMutatingUpdateProcessor.mutate(FieldValueMutatingUpdateProcessor.java:65)
        at org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:97)
        at org.apache.solr.handler.loader.JavabinLoader$1.update(JavabinLoader.java:96)
        at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readOuterMostDocIterator(JavaBinUpdateRequestCodec.java:166)
        at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readIterator(JavaBinUpdateRequestCodec.java:136)
        at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:225)
        at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readNamedList(JavaBinUpdateRequestCodec.java:121)
        at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:190)
        at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:116)
        at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec.unmarshal(JavaBinUpdateRequestCodec.java:173)
        at org.apache.solr.handler.loader.JavabinLoader.parseAndLoadDocs(JavabinLoader.java:106)
        at org.apache.solr.handler.loader.JavabinLoader.load(JavabinLoader.java:58)
        at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
        at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1956)
        at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:799)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:422)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
        at com.apple.cie.search.plugin.auth.TrustFilter.doFilter(TrustFilter.java:43)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:368)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
        at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:953)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
        at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:745)

        I wonder if we shouldn't just add a null check to FieldValueMutatingUpdateProcessor.mutate for null field value instead of making the codec skip serializing/deserializing nulls.

        Show
        Jessica Cheng Mallet added a comment - We're also seeing this with the javabin codec: null:java.lang.NullPointerException at org.apache.solr.update.processor.FieldValueMutatingUpdateProcessor.mutate(FieldValueMutatingUpdateProcessor.java:65) at org.apache.solr.update.processor.FieldMutatingUpdateProcessor.processAdd(FieldMutatingUpdateProcessor.java:97) at org.apache.solr.handler.loader.JavabinLoader$1.update(JavabinLoader.java:96) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readOuterMostDocIterator(JavaBinUpdateRequestCodec.java:166) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readIterator(JavaBinUpdateRequestCodec.java:136) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:225) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$1.readNamedList(JavaBinUpdateRequestCodec.java:121) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:190) at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:116) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec.unmarshal(JavaBinUpdateRequestCodec.java:173) at org.apache.solr.handler.loader.JavabinLoader.parseAndLoadDocs(JavabinLoader.java:106) at org.apache.solr.handler.loader.JavabinLoader.load(JavabinLoader.java:58) at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92) at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1956) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:799) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:422) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) at com.apple.cie.search.plugin.auth.TrustFilter.doFilter(TrustFilter.java:43) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:368) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:953) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72) at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745) I wonder if we shouldn't just add a null check to FieldValueMutatingUpdateProcessor.mutate for null field value instead of making the codec skip serializing/deserializing nulls.
        Hide
        ASF subversion and git services added a comment -

        Commit 1644865 from Noble Paul in branch 'dev/trunk'
        [ https://svn.apache.org/r1644865 ]

        SOLR-6626 NPE in FieldMutatingUpdateProcessor when indexing a doc with

        Show
        ASF subversion and git services added a comment - Commit 1644865 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1644865 ] SOLR-6626 NPE in FieldMutatingUpdateProcessor when indexing a doc with
        Hide
        ASF subversion and git services added a comment -

        Commit 1644866 from Noble Paul in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1644866 ]

        SOLR-6626 NPE in FieldMutatingUpdateProcessor when indexing a doc with null field value

        Show
        ASF subversion and git services added a comment - Commit 1644866 from Noble Paul in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1644866 ] SOLR-6626 NPE in FieldMutatingUpdateProcessor when indexing a doc with null field value
        Hide
        Jessica Cheng Mallet added a comment -

        A similar NPE is happening in AllValuesOrNoneFieldMutatingUpdateProcessor. Should I open a new Jira for that?

        Show
        Jessica Cheng Mallet added a comment - A similar NPE is happening in AllValuesOrNoneFieldMutatingUpdateProcessor. Should I open a new Jira for that?
        Hide
        ASF subversion and git services added a comment -

        Commit 1646388 from Noble Paul in branch 'dev/trunk'
        [ https://svn.apache.org/r1646388 ]

        SOLR-6626 NPE when the filed values are null

        Show
        ASF subversion and git services added a comment - Commit 1646388 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1646388 ] SOLR-6626 NPE when the filed values are null
        Hide
        ASF subversion and git services added a comment -

        Commit 1646389 from Noble Paul in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1646389 ]

        SOLR-6626 NPE when the field values are null

        Show
        ASF subversion and git services added a comment - Commit 1646389 from Noble Paul in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1646389 ] SOLR-6626 NPE when the field values are null
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Noble Paul
            Reporter:
            Paul Baclace
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development