.NET Client Connection Issue

NEST/Elasticsearch.Net version : 7.17.1

Elasticsearch version : 7.16.2 (standalone instance)

.NET runtime version : Framework 4.7.1

Operating system version : Windows 10 ENT (build 19042)

Description of the problem including expected versus actual behavior :
Trying to establish a BASIC-auth connection, over plain http:// and query the endpoint (any request). This is on a local network, and from within the same process, I have no problem connecting using the low-level client, using the same connection settings.

I am getting the dreaded:
"The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call"

Steps to reproduce :

  1. Build a ConnectionSettings object using a SingleNodeConnectionPool( new Uri(http://xyz.myorg.mydom:9200)) ,
    and Basic.Authentication(usr, pwd).
    The URL resolves to an IP via hosts file.
  2. Connect using regular means (some of the additional 'stuff' below is me struggling to understand/troubleshoot)
 _connSettings.EnableApiVersioningHeader().EnableDebugMode();
_connSettings.DisableAutomaticProxyDetection(true);
_nestClient = new Nest.ElasticClient(connSettings); 

  1. Calling any method that hits the ES endpoint, like for example:
    GetLifecycleResponse polResponse = _nestClient.IndexLifecycleManagement.GetLifecycle(new GetLifecycleRequest(policyName));
    will raise the error; turns out (please see the debug trace below) the client tries to connect to localhost:9200 all the time.

Expected behavior
I expect the client to connect to the running instance (on the local network); once again, an instance (singleton) of the lower-level , in the same process, client connects without problems (right before the NEST call, I make a successful call with the low-level client).

Provide ConnectionSettings (if relevant) : mentioned above.

Provide DebugInformation (if relevant) :

Invalid NEST response built from a unsuccessful () low level call on GET: /_ilm/policy/es_edr.policy
# Audit trail of this API call:
 - [1] ProductCheckOnStartup: Took: 00:00:04.0759481
 - [2] ProductCheckFailure: Node: http://localhost:9200/ Took: 00:00:04.0759481
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: 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.WebException: Unable to connect to the remote server ---> [System.Net](http://system.net/).Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9200
   at [System.Net](http://system.net/).Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at [System.Net](http://system.net/).ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at [System.Net](http://system.net/).HttpWebRequest.GetResponse()
   at [Elasticsearch.Net](http://elasticsearch.net/).HttpWebRequestConnection.Request[TResponse](RequestData requestData)
   --- End of inner exception stack trace ---
   at [Elasticsearch.Net](http://elasticsearch.net/).RequestPipeline.ThrowIfTransientProductCheckFailure()
   at [Elasticsearch.Net](http://elasticsearch.net/).RequestPipeline.Ping(Node node)
   at [Elasticsearch.Net](http://elasticsearch.net/).Transport`1.Ping(IRequestPipeline pipeline, Node node)
   at [Elasticsearch.Net](http://elasticsearch.net/).Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
   --- End of inner exception stack trace ---

I fixed the title of the post. It did not provide the actual question.

I'm not a .NET expert so perhaps one of them can answer.

But the first thing I would do is just try to curl the Elasticsearch cluster.

curl http://localhost:9200

Thank you @stephenb !

yes, if anyone with a possible interest in this reads the details, they'll see I am well beyond basic connectivity issues (I do have various instances I have tinkered with over the past few months).

This seems to be a specific NEST (higher-level abstraction layer) issue: with its lower-level counterpart - I have no problems connecting with.

Your time and effort is very much appreciated !

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