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

Cross-collection join when document is missing 'from' field throws NPE

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0, 8.10
    • query parsers
    • None

    Description

      When using method=crossCollection in a Join query, if a document does not have the field used for the from param, a NullPointerException is thrown.

      This is pretty simple to reproduce using the techproducts sample data (following assumes a clean install):

      $ ./bin/solr start -e cloud -noprompt
      
      $ ./bin/post -c gettingstarted example/exampledocs/*.xml
      
      $ curl 'http://localhost:8983/solr/gettingstarted/select' -F 'q={!join method="crossCollection" from=manu_id_s to=manu_id_s fromIndex=gettingstarted}*:*'
      
      {
        "responseHeader":{
          "zkConnected":true,
          "status":500,
          "QTime":335,
          "params":{
            "q":"{!join method=\"crossCollection\" from=manu_id_s to=manu_id_s fromIndex=gettingstarted}*:*"}},
        "error":{
          "metadata":[
            "error-class","org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException",
            "root-error-class","org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException"],
          "msg":"Error from server at null: java.lang.NullPointerException\n\tat org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:419)...
      

      Depending on which shard the error comes from, you might see a "No live SolrServers available to handle this request" error, but digging into the logs for the other shard that served the query will show the same NPE in the example above (I'll put a full stack trace into a comment).

      "Regular" (non-cross-collection) joins work fine if some documents are missing the field.

      If we shouldn't expect XCJF to work when documents are missing the from field, then we should document that as a limitation and also throw a more descriptive error.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hossman Chris M. Hostetter
            ctargett Cassandra Targett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment