Skip to content

Please add meaningful error message for bad credentials #8510

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

Open
ecrocombe opened this issue May 6, 2025 · 1 comment
Open

Please add meaningful error message for bad credentials #8510

ecrocombe opened this issue May 6, 2025 · 1 comment
Labels
8.x Relates to a 8.x client version 9.x Relates to a 9.x client version Category: Bug

Comments

@ecrocombe
Copy link

Elastic.Clients.Elasticsearch version: 8.17.1, also tested on 9.0.1, same thing.

Elasticsearch version: 8.17.1

.NET runtime version: 9.0.1

Operating system version: ubuntu x64 (24.04? LTS)

Description of the problem including expected versus actual behavior:
Originally published issue at https://discuss.elastic.co/t/nre-on-elasticsearchclient/377820

Exception message and trace is not very useful to diagnose an incorrect api key.

Expected behavior
An Exception message like "Authentication Failed" or something.

Actual behavior

System.NullReferenceException: Object reference not set to an instance of an object.
   at Elastic.Transport.DistributedTransport`1.RequestCoreAsync[TResponse](Boolean isAsync, EndpointPath path, PostData data, Action`1 configureActivity, IRequestConfiguration localConfiguration, CancellationToken cancellationToken)
   at Elastic.Clients.Elasticsearch.ElasticsearchClient.<>c__DisplayClass865_0`3.<<DoRequestCoreAsync>g__SendRequestWithProductCheckCore|2>d.MoveNext() in /_/src/Elastic.Clients.Elasticsearch/_Shared/Client/ElasticsearchClient.cs:line 221
--- End of stack trace from previous location ---
   at Elastic.Clients.Elasticsearch.ElasticsearchClient.<>c__DisplayClass865_0`3.<<DoRequestCoreAsync>g__SendRequestWithProductCheck|1>d.MoveNext() in /_/src/Elastic.Clients.Elasticsearch/_Shared/Client/ElasticsearchClient.cs:line 180
--- End of stack trace from previous location ---
   at Rust.Domain.Infrastructure.Searching.SearchProvider.HealthyAsync(CancellationToken cancellationToken) in /src/src/Rust.Domain/Infrastructure/Searching/SearchProvider.cs:line 21
   at Rust.GameserverIndexer.GameserverIndexer.EnsureIndexRebuiltAsync(CancellationToken cancellationToken) in /src/src/Rust.GameserverIndexer/GameserverIndexer.cs:line 64
   at Rust.GameserverIndexer.GameserverIndexer.EnsureIndexRebuiltAsync(CancellationToken cancellationToken) in /src/src/Rust.GameserverIndexer/GameserverIndexer.cs:line 67
   at Rust.GameserverIndexer.GameserverIndexer.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Rust.GameserverIndexer/GameserverIndexer.cs:line 39
   at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
@ecrocombe ecrocombe added 8.x Relates to a 8.x client version Category: Bug labels May 6, 2025
@flobernd
Copy link
Member

flobernd commented May 6, 2025

Hi @ecrocombe , thanks for reporting!

This definitely looks like a bug. A NullReferenceException should not be thrown in this case.

@flobernd flobernd added the 9.x Relates to a 9.x client version label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version 9.x Relates to a 9.x client version Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants