-
Notifications
You must be signed in to change notification settings - Fork 892
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
[BUG] Cluster endpoint test connection passed unexpectly #5707
Comments
Get following response by calling "client.info()" with endpoint "https://google.com." (Client is imported from @opensearch-project/opensearch). The response code is 301. But we not directly call opensearch-project/opensearch's client to do connection testing, instead we create wrappers on top of it. In the progress of checking our code base to root causing.
|
Because of this code: |
This is how a real success connection response looks like for "client.info()" call:
|
This is the real error looks like when there is a failure from "client.info()", and currently our test connection will fail only in this case.
|
Also we call "client.cat.indices()" in serverless scenario: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/data_source/server/routes/data_source_connection_validator.ts#L18 Also need to take the "client.cat.indices()" response formate into consideration |
Failed "client.cat.indices()"response by appending path name after the end point:
|
Failed "client.cat.indices()" response by using "https://google.com" endpoint:
|
Proposal to resolve this problem by:
Since "client.info()" and "client.cat.indices()" response body are in different formats, thus response body don't have a happy path which able to apply both APIs, so propose to only depend on response status code (200) as the single source of truth that refers to "connection testing success". Please feel free to leave comments if there are any concerns regarding this proposal~ Thanks~ |
Thanks @xinruiba for investigating this. I agree with you. Let's only depend upon status code. Question: In case of serverless, what |
Thanks @bandinib-amzn for the comment and response. Based on this comment: Let me take a further investigation, to see what will happen if we call |
I created a serverless cluster and do following validation:
In summary, for serverless cluster, |
Got it. Thanks @xinruiba for checking. Looking forward to PR fixing this issue. |
Get a comment from @Flyingliuhub to add more validations based on response body, which make sense to me.
|
This issue get fixed here:#5663 |
Describe the bug
Context:
I create a opensearch domain in my own aws account, and when I try to create a datasource with some different endpoints with my user name and password, I notice the test connection still pass.
Example:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Test Connection should fail since "https://google.com" since is not a cluster endpoint
In scope
Using this task to:
Out of scope
Since this ticket is to do bug fix, so following staff are not in scope:
The text was updated successfully, but these errors were encountered: