Solr
  1. Solr
  2. SOLR-6706

/update/json/docs throws RuntimeException if a nested structure contains a non-leaf float field

    Details

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

      Description

      The following JSON throws an exception:

      {
              "a_string" : "abc",
              "a_num" : 2.0,
              "a" : {
                              "b" : [
                                      {"id":"1", "title" : "test1"},
                                      {"id":"2", "title" : "test2"}
                              ]
                      }
      }
      
      curl 'http://localhost:8983/solr/collection1/update/json/docs?split=/a/b&f=id:/a/b/id&f=title_s:/a/b/title&indent=on' -H 'Content-type:application/json' -d @test2.json
      {
        "responseHeader":{
          "status":500,
          "QTime":0},
        "error":{
          "msg":"unexpected token 3",
          "trace":"java.lang.RuntimeException: unexpected token 3\n\tat org.apache.solr.common.util.JsonRecordReader$Node.handleObjectStart(JsonRecordReader.java:400)\n\tat org.apache.solr.common.util.JsonRecordReader$Node.parse(JsonRecordReader.java:281)\n\tat org.apache.solr.common.util.JsonRecordReader$Node.access$200(JsonRecordReader.java:152)\n\tat org.apache.solr.common.util.JsonRecordReader.streamRecords(JsonRecordReader.java:136)\n\tat org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.handleSplitMode(JsonLoader.java:200)\n\tat org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.processUpdate(JsonLoader.java:120)\n\tat org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.load(JsonLoader.java:106)\n\tat org.apache.solr.handler.loader.JsonLoader.load(JsonLoader.java:68)\n\tat org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:99)\n\tat org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)\n\tat org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)\n\tat org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)\n\tat org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat java.lang.Thread.run(Thread.java:745)\n",
          "code":500}}
      

      If I change a_num to an integer or remove it entirely then the document is indexed successfully.

      1. SOLR-6706.patch
        1 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        Test to reproduce this bug.

        Show
        Shalin Shekhar Mangar added a comment - Test to reproduce this bug.
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6706

        Show
        ASF subversion and git services added a comment - Commit 1636900 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1636900 ] SOLR-6706
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6706 missed changes.txt

        Show
        ASF subversion and git services added a comment - Commit 1636904 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1636904 ] SOLR-6706 missed changes.txt
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6706

        Show
        ASF subversion and git services added a comment - Commit 1636905 from Noble Paul in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1636905 ] SOLR-6706
        Hide
        Steve Rowe added a comment -

        Noble Paul, shouldn't this be backported to the 4.10 branch?

        Show
        Steve Rowe added a comment - Noble Paul , shouldn't this be backported to the 4.10 branch?
        Hide
        Noble Paul added a comment -

        If there is another 4.10.x release coming up, we should definitely do it. Otherwise , it is already checked into trunk and 5x

        Show
        Noble Paul added a comment - If there is another 4.10.x release coming up, we should definitely do it. Otherwise , it is already checked into trunk and 5x
        Hide
        Steve Rowe added a comment -

        13 Solr issues committed so far to the 4.10 branch in preparation for a 4.10.3 release - this is a 4.10 feature, so there's no doubt in my mind that it should be backported: https://issues.apache.org/jira/issues/?jql=project%20%3D%20SOLR%20AND%20fixVersion%20%3D%204.10.3%20ORDER%20BY%20updated%20DESC%2C%20priority%20DESC%2C%20created%20ASC

        Show
        Steve Rowe added a comment - 13 Solr issues committed so far to the 4.10 branch in preparation for a 4.10.3 release - this is a 4.10 feature, so there's no doubt in my mind that it should be backported: https://issues.apache.org/jira/issues/?jql=project%20%3D%20SOLR%20AND%20fixVersion%20%3D%204.10.3%20ORDER%20BY%20updated%20DESC%2C%20priority%20DESC%2C%20created%20ASC
        Hide
        Shalin Shekhar Mangar added a comment -

        Reopening to backport to 4.10.3

        Show
        Shalin Shekhar Mangar added a comment - Reopening to backport to 4.10.3
        Hide
        ASF subversion and git services added a comment -

        Commit 1642730 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_10'
        [ https://svn.apache.org/r1642730 ]

        SOLR-6706: /update/json/docs throws RuntimeException if a nested structure contains a non-leaf float field

        Show
        ASF subversion and git services added a comment - Commit 1642730 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1642730 ] SOLR-6706 : /update/json/docs throws RuntimeException if a nested structure contains a non-leaf float field
        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:
            Shalin Shekhar Mangar
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development