Invalid NEST response built from a unsuccessful () low level call on POST using .NET Nest

New to ElasticSearch. I've seen a couple posts with similar titles but didn't seem to apply to me. I'm having trouble querying my ES cluster for the first time. Someone else creaed the cluster and gave me login info.

My code looks like this:

var settings = new ConnectionSettings(new Uri("server"))
            .BasicAuthentication("user", "pw")
            .DefaultIndex("index");

var client = new ElasticClient(settings); 

var searchResponse = client.Search<mdl.Event>(s => s
                    .Query(q => q
                        .QueryString(qs => qs
                            .Query("Hello"))
                        && q
                        .DateRange(r => r
                            .Field(f => f.CreatedTimeStamp)
                            .GreaterThanOrEquals(search.From)
                            .LessThanOrEquals(search.To))));
                Console.Write(searchResponse);

I am getting no errors with this code. Only when I have the Console.Write statement I included do I get any detail. It reads:

Invalid NEST response built from a unsuccessful () low level call on POST: /index/_search?typed_keys=true

I'm not sure what is going wrong here. Is there an issue with the index or a quick fix to this issue?

Hi @bensalerno,

It's hard to say what caused this but the SearchResponse object includes some properties you can inspect during debugging and/or log which will help identify the cause.

The most useful to start with are:

if (!searchResponse.IsValid)
{
	// Handle errors
	var debugInfo = searchResponse.DebugInformation;
	var error = searchResponse.ServerError.Error;
}
  • IsValid will be false if the request failed for some reason.
  • DebugInformationis a string and includes the audit trail for the request. You can enable extra details in the configuration by enabling Debug Mode.
  • The ServerError property returns an object you can inspect to find various details from the server which may explain why a search failed.

I hope that answers your question and helps you debug a bit further.

Steve

1 Like

I've returned the debug information - it reads like this:

The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code unknown from: GET / ---> Elasticsearch.Net.PipelineException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+AppleCrypto+SslException: misc. bad certificate

I imagine this has something to do with settings my certificates. I posted another question similar to this - Using certificates with ElasticSearch Nest client? - #2 by stevejgordon - but I'm still not entirely sure how to use all of my certificates

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.