Skip to content

Should ElasticsearchIndicesClient#existsIndexTemplate() with invalid credentials return false or ElasticsearchException(security_exception, 401) #212

Open
@cyrille-leclerc

Description

@cyrille-leclerc

Java API client version

8.1.0

Java version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

Elasticsearch Version

8.1.0

Problem description

ElasticsearchIndicesClient#existsIndexTemplate() with invalid credentials returns false when I expected the returned valued to be an ElasticsearchException(security_exception, 401) that would have been consistent with the returned value of methods like ElasticsearchIlmClient#getLifecycle().

Could you please clarify the expected behaviour? I expected an ElasticsearchException(security_exception, 401) and got surprised.

See https://github.com/jenkinsci/opentelemetry-plugin/blob/opentelemetry-2.3.0-rc1/src/main/java/io/jenkins/plugins/opentelemetry/backend/elastic/ElasticsearchLogStorageRetriever.java#L218-L243

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions