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

Occasional NullPointerException in CloudSolrClient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 6.6.1
    • 7.2, 8.0
    • SolrJ
    • None

    Description

      When sending document updates to Solr, we occasionally see the following error:

      java.lang.NullPointerException
      	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:1182)
      	at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:1073)
      	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:160)
      	at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:173)
      	at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:138)
      	at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:152)
      

      Looking at the code, there is a lack of null check on requestedCollections around the for loop
      for (DocCollection ext : requestedCollections)
      which causes the error. Wrapping this loop with if(requestedCollections != null) would solve the problem.

      Attachments

        Issue Links

          Activity

            People

              tflobbe Tomas Eduardo Fernandez Lobbe
              bob3.1415926 Rob Trickey
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: