You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Eirik Lygre (JIRA)" <ji...@apache.org> on 2015/06/11 11:25:01 UTC

[jira] [Updated] (SOLR-7664) Solrj client throws ParseException("Illegal content type") when server returns "other http error" (here 413) with BinaryResponseParser

     [ https://issues.apache.org/jira/browse/SOLR-7664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eirik Lygre updated SOLR-7664:
------------------------------
    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, with 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.

  was:
We have a program that uses Solrj to index data. For some as-of-yet undetermined reason, the server 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, with 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.


> Solrj client throws ParseException("Illegal content type") when server returns "other http error" (here 413) with BinaryResponseParser
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-7664
>                 URL: https://issues.apache.org/jira/browse/SOLR-7664
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>    Affects Versions: 5.2
>            Reporter: Eirik Lygre
>
> 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, with 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org