Closed
Description
Elastic.Clients.Elasticsearch version: 8.1.1
Elasticsearch version: 8.6.1
.NET runtime version: 6.0
Operating system version: Windows 10 22H2
Description of the problem including expected versus actual behavior:
After upgrading to the new client, Ping
method fails either with previous or minimal configuration.
While debugging I tracked it down to this line in HttpTransportClient
method public override TResponse Request<TResponse>(RequestData requestData)
:
mimeType = responseMessage.Content.Headers.ContentType.ToString();
The exception is thrown because the response content does not have any headers.
Steps to reproduce:
- Create new
ElasticsearchClient
with the settings below - Call
ElasticsearchClient.Ping()
- See
UnexpectedTransportException
with innerNullReferenceException
Expected behavior
Ping succeeds.
Provide ConnectionSettings
(if relevant):
new ElasticsearchClientSettings(Uri)
.Authentication(new BasicAuthentication(userName, password));