Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9254

GraphTermsQueryQParserPlugin throws NPE when field being searched is not present in segment

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      My Jenkins found a reproducing seed on branch_6x:

      Checking out Revision d1a047ad6f24078f23c9b4adf15210ac8a6e8f8a (refs/remotes/origin/branch_6x)
      [...]
         [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestGraphTermsQParserPlugin -Dtests.method=testQueries -Dtests.seed=E47472DC605D2D21 -Dtests.slow=true -Dtests.linedocsfile=/home/jenkins/lucene-data/enwiki.random.lines.txt -Dtests.locale=sr-Latn-ME -Dtests.timezone=America/Guadeloupe -Dtests.asserts=true -Dtests.file.encoding=UTF-8
         [junit4] ERROR   0.06s J11 | TestGraphTermsQParserPlugin.testQueries <<<
         [junit4]    > Throwable #1: java.lang.RuntimeException: Exception during query
         [junit4]    > 	at __randomizedtesting.SeedInfo.seed([E47472DC605D2D21:B8FABE077A34988F]:0)
         [junit4]    > 	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:781)
         [junit4]    > 	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:748)
         [junit4]    > 	at org.apache.solr.search.TestGraphTermsQParserPlugin.testQueries(TestGraphTermsQParserPlugin.java:76)
         [junit4]    > 	at java.lang.Thread.run(Thread.java:745)
         [junit4]    > Caused by: java.lang.NullPointerException
         [junit4]    > 	at org.apache.solr.search.GraphTermsQParserPlugin$GraphTermsQuery$1.rewrite(GraphTermsQParserPlugin.java:223)
         [junit4]    > 	at org.apache.solr.search.GraphTermsQParserPlugin$GraphTermsQuery$1.bulkScorer(GraphTermsQParserPlugin.java:252)
         [junit4]    > 	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:666)
         [junit4]    > 	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
         [junit4]    > 	at org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:261)
         [junit4]    > 	at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1818)
         [junit4]    > 	at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1635)
         [junit4]    > 	at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:644)
         [junit4]    > 	at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:528)
         [junit4]    > 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:293)
         [junit4]    > 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:154)
         [junit4]    > 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2035)
         [junit4]    > 	at org.apache.solr.util.TestHarness.query(TestHarness.java:310)
         [junit4]    > 	at org.apache.solr.util.TestHarness.query(TestHarness.java:292)
         [junit4]    > 	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:755)
         [junit4]    > 	... 41 more
         [junit4]   2> NOTE: test params are: codec=Asserting(Lucene62): {test_tl=PostingsFormat(name=Direct), _version_=BlockTreeOrds(blocksize=128), test_ti=BlockTreeOrds(blocksize=128), term_s=PostingsFormat(name=Asserting), test_tf=PostingsFormat(name=LuceneVarGapDocFreqInterval), id=PostingsFormat(name=LuceneVarGapDocFreqInterval), group_s=PostingsFormat(name=LuceneVarGapDocFreqInterval)}, docValues:{}, maxPointsInLeafNode=1102, maxMBSortInHeap=5.004024995692577, sim=ClassicSimilarity, locale=sr-Latn-ME, timezone=America/Guadeloupe
         [junit4]   2> NOTE: Linux 4.1.0-custom2-amd64 amd64/Oracle Corporation 1.8.0_77 (64-bit)/cpus=16,threads=1,free=283609904,total=531628032
      

        Issue Links

          Activity

          Hide
          steve_rowe Steve Rowe added a comment -

          The above seed reproduces for me on master too.

          Show
          steve_rowe Steve Rowe added a comment - The above seed reproduces for me on master too.
          Hide
          joel.bernstein Joel Bernstein added a comment -

          I'll take a look.

          Show
          joel.bernstein Joel Bernstein added a comment - I'll take a look.
          Hide
          joel.bernstein Joel Bernstein added a comment -

          There is an NPE that needs to be guarded against, incase an index segment doesn't include the field being searched. I will push a fix for this today.

          Show
          joel.bernstein Joel Bernstein added a comment - There is an NPE that needs to be guarded against, incase an index segment doesn't include the field being searched. I will push a fix for this today.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 407080af5bc68c9eb11c05c587368a783ff78d0c in lucene-solr's branch refs/heads/master from jbernste
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=407080a ]

          SOLR-9254: GraphTermsQueryQParserPlugin throws NPE when field being search is not present in segment

          Show
          jira-bot ASF subversion and git services added a comment - Commit 407080af5bc68c9eb11c05c587368a783ff78d0c in lucene-solr's branch refs/heads/master from jbernste [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=407080a ] SOLR-9254 : GraphTermsQueryQParserPlugin throws NPE when field being search is not present in segment
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 59c5e6014bc8f2e3f89a269938145dc7da5e9019 in lucene-solr's branch refs/heads/branch_6x from jbernste
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=59c5e60 ]

          SOLR-9254: GraphTermsQueryQParserPlugin throws NPE when field being search is not present in segment

          Show
          jira-bot ASF subversion and git services added a comment - Commit 59c5e6014bc8f2e3f89a269938145dc7da5e9019 in lucene-solr's branch refs/heads/branch_6x from jbernste [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=59c5e60 ] SOLR-9254 : GraphTermsQueryQParserPlugin throws NPE when field being search is not present in segment
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 3f7acb5cf90e8e3e7ed21e927d10b867d0b307f1 in lucene-solr's branch refs/heads/master from jbernste
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3f7acb5 ]

          SOLR-9254: Fixed typo in CHANGES.txt

          Show
          jira-bot ASF subversion and git services added a comment - Commit 3f7acb5cf90e8e3e7ed21e927d10b867d0b307f1 in lucene-solr's branch refs/heads/master from jbernste [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3f7acb5 ] SOLR-9254 : Fixed typo in CHANGES.txt
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 723fc1dc8560b4255cca5fe198115c894205683c in lucene-solr's branch refs/heads/branch_6x from jbernste
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=723fc1d ]

          SOLR-9254: Fixed typo in CHANGES.txt

          Show
          jira-bot ASF subversion and git services added a comment - Commit 723fc1dc8560b4255cca5fe198115c894205683c in lucene-solr's branch refs/heads/branch_6x from jbernste [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=723fc1d ] SOLR-9254 : Fixed typo in CHANGES.txt
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

            People

            • Assignee:
              joel.bernstein Joel Bernstein
              Reporter:
              steve_rowe Steve Rowe
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development