Elastic search authentiation Invalid NEST response built from a unsuccessful low level call

public ElasticClient EsClient()
{
var nodes = new Uri
{
new Uri($"{_config.ElasticUrl}"),
};

        var connectionPool = new StaticConnectionPool(nodes);
        var connectionSettings = new ConnectionSettings(connectionPool)
                    .BasicAuthentication("ID", "PWD");
        var elasticClient = new ElasticClient(connectionSettings);

        return elasticClient;
    }

what is the problem with connection?

Invalid NEST response built from a unsuccessful () low level call on PUT: 9200/onoff-products/_doc/82

Audit trail of this API call:

  • [1] PingFailure: Node: kibana.onoff.ge:9200/ Exception: NotSupportedException Took: 00:00:00.0069832

OriginalException: Elasticsearch.Net.ElasticsearchClientException: Failed to ping the specified node.. Call: unknown resource ---> Elasticsearch.Net.PipelineException: Failed to ping the specified node. ---> System.NotSupportedException: The URI prefix is not recognized.

at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at Elasticsearch.Net.HttpWebRequestConnection.CreateWebRequest(RequestData requestData)
at Elasticsearch.Net.HttpWebRequestConnection.CreateHttpWebRequest(RequestData requestData)
at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)
at Elasticsearch.Net.RequestPipeline.Ping(Node node)
--- End of inner exception stack trace ---
at Elasticsearch.Net.RequestPipeline.Ping(Node node)
at Elasticsearch.Net.Transport1.Ping(IRequestPipeline pipeline, Node node) at Elasticsearch.Net.Transport1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
--- End of inner exception stack trace ---

Audit exception in step 1 PingFailure:

System.NotSupportedException: The URI prefix is not recognized.
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at Elasticsearch.Net.HttpWebRequestConnection.CreateWebRequest(RequestData requestData)
at Elasticsearch.Net.HttpWebRequestConnection.CreateHttpWebRequest(RequestData requestData)
at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)
at Elasticsearch.Net.RequestPipeline.Ping(Node node)

Request:

<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

Response:

<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

Looks like there is an issue with the URI in your config file. Should be either http://kibana.onoff.ge:9200 or https://kibana.onoff.ge:9200.

it should be https, but when `i am trying https://kibana.onoff.ge:9200 this uri besides this kibana.onoff.ge:9200 this gives me this error as original exeption.{"Failed to ping the specified node.. Call: Status code unknown from: HEAD /"}

What version of the client are you using e.g. NEST 7.3.0?

yes i am using 7.3

Can you make a HEAD request to https://kibana.onoff.ge:9200 outside of the client, on the same machine? For example, with PowerShell

$user = "ID"
$password = "PWD" | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($user , $password)

Invoke-WebRequest "https://kibana.onoff.ge:9200" -Method Head -Credential $credential `
    -UseBasicParsing -ContentType "application/json"

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