You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ryan Qin <rq...@opentext.com> on 2018/09/29 09:08:07 UTC

SolrJ cannot get actual cause of error

Hi there,

I'm working on a project which uses solr as search engine. I found I cannot get the root cause of error from SolrJ.

Case 1
I try to create a field with wrong field type

        Map<String, Object> fieldd = new LinkedHashMap<String, Object>();
        fieldd.put("name", "eeeee");
        fieldd.put("type", "srting");
        fieldd.put("stored", true);
        fieldd.put("indexed", true);

        SchemaRequest.AddField addFieldRequest = new SchemaRequest.AddField(fieldd);
        addFieldRequest.process(client, "gettingstarted");

The exception I got is like:

1167 [main] ERROR org.apache.solr.client.solrj.impl.CloudSolrClient - Request to collection [gettingstarted] failed due to (400) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteExecutionException: Error from server at http://10.0.75.1:7574/solr/gettingstarted: error processing commands, retry? 0

The root cause is wrapped very deep, like:

[cid:image001.png@01D45816.599C3040]

Case 2

I try to get an non-existence field.

        SchemaRequest.Field request = new SchemaRequest.Field("noexistfield");
        FieldResponse response = request.process(client, "gettingstarted");

The error message is like

No live SolrServers available to handle this request:[http://10.0.75.1:7574/solr/gettingstarted, http://10.0.75.1:8983/solr/gettingstarted]


Many other errors have the same problems. I have to do a lot pre-checking in code to get the actual reason, which is very inconvenient and affects performance. Coud Solr provide a method to get the real cause easily, like "getRootCause()" in SolrJ? Thanks!


Best Regards,
Ryan

Re: SolrJ cannot get actual cause of error

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/29/2018 3:08 AM, Ryan Qin wrote:
> I’m working on a project which uses solr as search engine. I found I 
> cannot get the root cause of error from SolrJ.

CloudSolrClient uses LBHttpSolrClient internally.  This client has a 
tendency to wrap all exceptions in the "No live SolrServers" message.  
There is an existing issue for that problem:

https://issues.apache.org/jira/browse/SOLR-7951

That issue is three years old, and sorta fizzled out without really 
going anywhere.  There hasn't been any activity in Jira for nearly two 
years.

> The root cause is wrapped very deep, like:
>

The image that you attached did not make it to the list. We can't see 
it.  Apache mailing lists remove most attachments.  Using a paste 
website or a file sharing site is the best option for sharing content.

Even if SOLR-7951 is fixed, root causes will still often be deeply 
nested in exceptions, and the level of nesting varies widely.  Because 
the innermost exception in the nesting may not actually say anything 
useful about the root cause, trying to determine a root cause 
programmatically is very difficult.  It usually takes review by a 
person, looking at ALL of the "Caused by" messages closely.  Often the 
problem may only make sense to someone who's actually familiar with the 
code, and the exact version of Solr is required to decipher them.  The 
goal is to have error messages that ANYONE can understand ... but 
reaching that goal can be very difficult.

Thanks,
Shawn


Re: SolrJ cannot get actual cause of error

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you can still see the same behavior in 7.5 (some things were rewritten),
this could be a reasonable enhancement Jira with suggested patch attached.

Regards,
   Alex.

On Sat, 29 Sep 2018 at 07:25, Ryan Qin <rq...@opentext.com> wrote:

> Hi there,
>
>
>
> I’m working on a project which uses solr as search engine. I found I
> cannot get the root cause of error from SolrJ.
>
>
>
> *Case 1*
>
> I try to create a field with wrong field type
>
>
>
>         Map<String, Object> fieldd = *new* LinkedHashMap<String,
> Object>();
>
>         fieldd.put("name", "eeeee");
>
>         fieldd.put("type", "srting");
>
>         fieldd.put("stored", *true*);
>
>         fieldd.put("indexed", *true*);
>
>
>
>         SchemaRequest.AddField addFieldRequest = *new*
> SchemaRequest.AddField(fieldd);
>
>         addFieldRequest.process(*client*, "gettingstarted");
>
>
>
> The exception I got is like:
>
>
>
> 1167 [main] ERROR org.apache.solr.client.solrj.impl.CloudSolrClient -
> Request to collection [gettingstarted] failed due to (400)
> *org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteExecutionException*:
> Error from server at http://10.0.75.1:7574/solr/gettingstarted: error
> processing commands, retry? 0
>
>
>
> The root cause is wrapped very deep, like:
>
>
>
>
>
> *Case 2*
>
>
>
> I try to get an non-existence field.
>
>
>
>         SchemaRequest.Field request = *new* SchemaRequest.Field(
> "noexistfield");
>
>         FieldResponse *response* = request.process(*client*,
> "gettingstarted");
>
>
>
> The error message is like
>
>
>
> No live SolrServers available to handle this request:[
> http://10.0.75.1:7574/solr/gettingstarted,
> http://10.0.75.1:8983/solr/gettingstarted]
>
>
>
>
>
> Many other errors have the same problems. I have to do a lot pre-checking
> in code to get the actual reason, which is very inconvenient and affects
> performance. Coud Solr provide a method to get the real cause easily, like
> “getRootCause()” in SolrJ? Thanks!
>
>
>
>
> Best Regards,
>
> Ryan
>