Skip to content

Ping fails due to NullReferenceException after upgrading #7752

Closed
@VMelnalksnis

Description

@VMelnalksnis

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:

  1. Create new ElasticsearchClient with the settings below
  2. Call ElasticsearchClient.Ping()
  3. See UnexpectedTransportException with inner NullReferenceException

Expected behavior
Ping succeeds.

Provide ConnectionSettings (if relevant):

new ElasticsearchClientSettings(Uri)
    .Authentication(new BasicAuthentication(userName, password));

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.xRelates to a 8.x client version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions