Solr
  1. Solr
  2. SOLR-1563

binary fields caused a null pointer exception in the luke request handler

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4.1, 1.5, 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      Multiple reports of NPEs when using Solr 1.4 - so far these all seem to relate to getting a null returned by Fieldable.stringValue when it isn't expected or accounted for. Thread where this was initially discussed...

      http://old.nabble.com/NPE-when-trying-to-view-a-specific-document-via-Luke-to26330237.html

      1. SOLR-1563.patch
        4 kB
        Yonik Seeley

        Activity

        Hide
        Hoss Man added a comment -

        Committed revision 949889.

        merged to branch-1.4 for 1.4.1

        Show
        Hoss Man added a comment - Committed revision 949889. merged to branch-1.4 for 1.4.1
        Hide
        Hoss Man added a comment -

        Correcting Fix Version based on CHANGES.txt, see this thread for more details...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Show
        Hoss Man added a comment - Correcting Fix Version based on CHANGES.txt, see this thread for more details... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E
        Hide
        Yonik Seeley added a comment -

        committed.

        Show
        Yonik Seeley added a comment - committed.
        Hide
        Yonik Seeley added a comment -

        Attaching patch that fixes luke, and adds support for binary fields.

        Show
        Yonik Seeley added a comment - Attaching patch that fixes luke, and adds support for binary fields.
        Hide
        Hoss Man added a comment -

        In all of the stack traces listed above, the NPE seems to be orriginating from an attempt to derefrence a string value that was returned by Fieldable.stringValue higher up in the call stack.

        Given the number of different code paths involved (some of which haven't changed from Solr 1.3 to Solr 1.4) I can't help but think something changed deep in lucene to cause null to be returned in cases where it wasn't returned in older versions of Lucene. So far i haven't been able to figure out where.

        Show
        Hoss Man added a comment - In all of the stack traces listed above, the NPE seems to be orriginating from an attempt to derefrence a string value that was returned by Fieldable.stringValue higher up in the call stack. Given the number of different code paths involved (some of which haven't changed from Solr 1.3 to Solr 1.4) I can't help but think something changed deep in lucene to cause null to be returned in cases where it wasn't returned in older versions of Lucene. So far i haven't been able to figure out where.
        Hide
        Hoss Man added a comment - - edited


        I've deleted this comment, because the error case it describes is based on a completley faulty testing method ... i wasn't paying close enough attention to what data dir was getting used.

        Show
        Hoss Man added a comment - - edited I've deleted this comment, because the error case it describes is based on a completley faulty testing method ... i wasn't paying close enough attention to what data dir was getting used.
        Hide
        Hoss Man added a comment -

        The following stack trace was generated using Solr 1.4, and the "example" configs provided with Solr 1.4.

        Steps to reproduce...

        1. cd example && java -jar start.jar
        2. cd example/exampledocs && java -jar post.jar *.xml
        3. open in browser: http://localhost:8983/solr/select/?q=SP2514N (this works fine)
        4. open in browser: http://localhost:8983/solr/admin/luke?id=SP2514N (this fails with stack trace below)
        java.lang.NullPointerException
        	at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95)
        	at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:158)
        	at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232)
        	at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179)
        	at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975)
        	at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627)
        	at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308)
        	at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248)
        	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124)
        	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
        
        Show
        Hoss Man added a comment - The following stack trace was generated using Solr 1.4, and the "example" configs provided with Solr 1.4. Steps to reproduce... cd example && java -jar start.jar cd example/exampledocs && java -jar post.jar *.xml open in browser: http://localhost:8983/solr/select/?q=SP2514N (this works fine) open in browser: http://localhost:8983/solr/admin/luke?id=SP2514N (this fails with stack trace below) java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:158) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975) at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627) at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308) at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248) at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
        Hide
        Hoss Man added a comment -

        Second anecdotal exception reported by Solr Trey, also while using luke to look at a specific document id. no details about schema...

        HTTP Status 500 - null java.lang.NullPointerException at
        org.apache.lucene.index.Term.compareTo(Term.java:119) at
        org.apache.lucene.index.TermInfosReader.getIndexOffset(TermInfosReader.java:160)
        at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:231) at
        org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at
        org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975) at
        org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627) at
        org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308) at
        org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248)
        at
        org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124)
        at
        org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
        
        Show
        Hoss Man added a comment - Second anecdotal exception reported by Solr Trey, also while using luke to look at a specific document id. no details about schema... HTTP Status 500 - null java.lang.NullPointerException at org.apache.lucene.index.Term.compareTo(Term.java:119) at org.apache.lucene.index.TermInfosReader.getIndexOffset(TermInfosReader.java:160) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:231) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975) at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627) at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308) at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248) at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
        Hide
        Hoss Man added a comment -

        First anecdotal NPE stack trace reported by Jake Brownell when using LukeRequestHandler to look at a specific document id when using 1.4. No details about schema provided../

        /admin/luke?id=1
        
        1. java.lang.NullPointerException
        2.         at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95)
        3.         at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:158)
        4.         at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232)
        5.         at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179)
        6.         at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975)
        7.         at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627)
        8.         at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308)
        9.         at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248)
        10.        at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124)
        11.        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        12.        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
        
        Show
        Hoss Man added a comment - First anecdotal NPE stack trace reported by Jake Brownell when using LukeRequestHandler to look at a specific document id when using 1.4. No details about schema provided../ /admin/luke?id=1 1. java.lang.NullPointerException 2. at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) 3. at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:158) 4. at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) 5. at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) 6. at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975) 7. at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627) 8. at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308) 9. at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248) 10. at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124) 11. at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) 12. at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)

          People

          • Assignee:
            Unassigned
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development