[ 
https://issues.apache.org/jira/browse/SOLR-16929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17755762#comment-17755762
 ] 

Alex Deparvu commented on SOLR-16929:
-------------------------------------

I originally started working on reverting the change (apply it only in case of 
403) and it seems that the "error" handling of JavabinTupleStreamParser is 
simply missing. this coupled with the fact that /select and /export actually 
have different response formats in case of exceptions makes it so that the 
"/select and javabin" workflow is not reflecting the error correctly.

> SolrStream propagates undecoded error message
> ---------------------------------------------
>
>                 Key: SOLR-16929
>                 URL: https://issues.apache.org/jira/browse/SOLR-16929
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: streaming expressions
>    Affects Versions: 9.0
>            Reporter: Alex Deparvu
>            Priority: Minor
>
> SOLR-15451 introduced a change where the exception message included by the 
> SolrStream can sometimes be the encoded (javabin) string representation of 
> the remote exception.
> Just reading through SOLR-15451 I don't believe this was the intended result 
> here. I think the original change was aiming at providing the 403 auth repose 
> as string because that is a raw html response. and accidentally caused the 
> response format change across all possible streaming exceptions.
>  
> I think this might be due to consuming the stream response as string instead 
> of using a reader. See 'consumeStreamAsErrorMessage' method 
> [https://github.com/apache/solr/blob/main/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java#L335C18-L335C45]
> example based on existing test in Solr that is currently disabled 
> [https://github.com/apache/solr/blob/main/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java#L631]
>  * /select as json format (default)
> {noformat}
> java.util.concurrent.ExecutionException: java.io.IOException: Query to 
> '/streams_shard2_replica_n2/select?q=*:*&fl=a_s,a_i,a_f,blah&sort=blah+asc&distrib=false'
>  failed due to: (400) {
>     "responseHeader":{
>         "zkConnected":true,
>         "status":400,
>         "QTime":1
>       },
>       "error":{
>         
> "metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],
>         "msg":"sort param field can't be found: blah",
>         "code":400
>       }
>   } {noformat}
>  * /select as javabin format
> {noformat}
> java.util.concurrent.ExecutionException: java.io.IOException: Query to 
> '/streams_shard2_replica_n2/select?q=*:*&fl=a_s,a_i,a_f,blah&sort=blah+asc&wt=javabin&distrib=false'
>  failed due to: (400) 
> ��.responseHeader��+zkConnected�&statusP�%QTime�%error��(metadata��+error-class?org.apache.solr.common.SolrException�0root-error-class?org.apache.solr.common.SolrException�#msg?sort
>  param field can't be found: blah�$codeP
> {noformat}
>  * /export as json format
> {noformat}
> java.util.concurrent.ExecutionException: java.io.IOException: Query to 
> '/streams_collection_shard2_replica_n2/export?q=*:*&fl=a_s,a_i,a_f,blah&sort=blah+asc&distrib=false&indent=off'
>  failed due to: (400) 
> {"responseHeader":{"status":400},"response":{"numFound":0,"docs":[{"EXCEPTION":"sort
>  param field can't be found: blah"}]}}{noformat}
>  * /export as javabin format
> {noformat}
> java.util.concurrent.ExecutionException: java.io.IOException: Query to 
> '/streams_collection_shard2_replica_n2/export?q=*:*&fl=a_s,a_i,a_f,blah&sort=blah+asc&wt=javabin&distrib=false&indent=off'
>  failed due to: (400) �.responseHeader
> �&statusP�(response
> �(numFound�$docs�
> �)EXCEPTION?sort param field can't be found: blah
> {noformat}
>  
> error messages before this change:
> {noformat}
> java.util.concurrent.ExecutionException: java.io.IOException: --> 
> http://127.0.0.1:65079/solr:sort param field can't be found: blah{noformat}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to