Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health check fails for AspNetCore.HealthChecks.Elasticsearch:9.0.0 #2355

Open
NikiforovAll opened this issue Dec 30, 2024 · 6 comments
Open
Assignees

Comments

@NikiforovAll
Copy link

Please, fill the following sections to help us fix the issue

What happened:

Health check doesn't work due to transitive dependency issue:

[16:28:09] fail: Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService[104]
      Health check elasticsearch threw an unhandled exception after 2.8406ms
      System.TypeLoadException: Could not load type 'Elastic.Transport.TransportConfigurationBase`1' from assembly 'Elastic.Transport, Version=0.0.0.0, Culture=neutral, PublicKeyToken=069ca2728db333c1'.
         at HealthChecks.Elasticsearch.ElasticsearchHealthCheck.CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
         at HealthChecks.Elasticsearch.ElasticsearchHealthCheck.CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
         at Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService.RunCheckAsync(HealthCheckRegistration registration, CancellationToken cancellationToken)

This happens because we have a dependency on Elastic.Clients.Elasticsearch:8.16.3 which resolves transitive dependency to Elastic.Transport:0.5.7

What you expected to happen:

Health check should work as expected.

How to reproduce it (as minimally and precisely as possible):

Add to a project that references Elastic.Clients.Elasticsearch:8.16.3 and AspNetCore.HealthChecks.Elasticsearch:9.0.0 at the same time.

@NikiforovAll NikiforovAll changed the title Health cehck fails for AspNetCore.HealthChecks.Elasticsearch:9.0.0 Health check fails for AspNetCore.HealthChecks.Elasticsearch:9.0.0 Dec 30, 2024
@adamsitnik
Copy link
Collaborator

cc @Alirexaa @flobernd

@flobernd
Copy link

Our transport library Elastic.Transport is still in "pre-release" state (0.x.x version) which is bad, looking at this issue and other problems caused by the breaking changes that propagate to the Elastic.Clients.Elasticsearch package.

We are working on releasing a final version 1.0.0 for Elastic.Transport soon.

For now, there is not much we can do. It would probably be best to bump the Elasticsearch client package dependency in the next release of AspNetCore.HealthChecks.Elasticsearch.

@adamsitnik
Copy link
Collaborator

We are working on releasing a final version 1.0.0 for Elastic.Transport soon.

@flobernd Please ping us once it's available, we are then going to bump it and release a new version. Thanks!

@Alirexaa Alirexaa self-assigned this Jan 13, 2025
@vik-torr
Copy link

should
? new ElasticsearchClientSettings(_options.CloudId!, new ApiKey(_options.ApiKey!))
be
? new ElasticsearchClientSettings(_options.CloudId!, new ApiKey(_options.CloudApiKey!))

@kaidl
Copy link

kaidl commented Jan 17, 2025

Is there some workaround in the meantime?

@sergey-tihon
Copy link

@kaidl downgrade to AspNetCore.HealthChecks.Elasticsearch 8.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants