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

Solrj client throws ParseException("Illegal content type") when server returns "other http error" (here 413) with BinaryResponseParser

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.2
    • 5.3
    • SolrJ
    • None

    Description

      We have a program that uses Solrj to index data. For some (irrelevant) reason, the server sometimes returns "413 FULL Head" with no Content-Type header. When that happens, the Solrj library fails.

      In HttpSolrClient.executeMethod, two things happen:

      If there is no processor, then a RemoteSolrException is thrown, which is good. Ref https://github.com/apache/lucene-solr/blob/lucene_solr_5_2_0/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java#L493.

      However, when there is a processor, the code tries to call ContentType.parse() with the returned ContentType, which is null. This method throws a ParseException("Illegal content type"), which propagates to the client. The cause of the error is very much hidden now. Ref https://github.com/apache/lucene-solr/blob/lucene_solr_5_2_0/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java#L513.

      It would be nice if the client would throw a RemoteSolrException in this case, too.

      Attachments

        Issue Links

        Activity

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

          People

            andyetitmoves Ramkumar Aiyengar
            elygre Eirik Lygre
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment