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

David Smiley commented on SOLR-15159:
-------------------------------------

I think a simple fix is to modify 
{{org.apache.solr.client.solrj.impl.Http2SolrClient#processErrorsAndResponse(org.eclipse.jetty.client.api.Response,
 org.apache.solr.client.solrj.ResponseParser, java.io.InputStream, 
java.lang.String, java.lang.String, boolean)}} with code to compute the baseUrl 
by examining the Jetty {{Response}} passed to this method.  This should get us 
the scheme & host & port.  But the path is the full path (e.g. 
"solr/admin/collections") , not the base path (e.g. "solr").  I think that 
detail is minor; we don't need the path.  HttpSolrClient.executeMethod could 
have similar logic.

> Missing host in error message: "Error from server at null"
> ----------------------------------------------------------
>
>                 Key: SOLR-15159
>                 URL: https://issues.apache.org/jira/browse/SOLR-15159
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Priority: Major
>
> RemoteSolrException's first argument is a "baseUrl" and/or the host of Solr.  
> I've seen logged exceptions where it is null on occassion, which makes 
> debugging a bit harder.
> After looking at Http2SolrClient (and HttpSolrClient similarly), I can see 
> there is a "serverBaseUrl" or "baseUrl" field that is passed to this 
> exception.  This field can actually be null, despite it seeming like 
> something that is mandatory.  The reason is that a SolrRequest can itself 
> contain the path that is used (see SolrRequest.getBasePath).  There are some 
> internal SolrClient instances that are configured with no default baseUrl and 
> thus the request must always supply this... such as HttpShardHandlerFactory 
> "defaultClient".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to