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

[BUG] Creating no auth data connection fails validaiton #5987

Closed
derek-ho opened this issue Feb 29, 2024 · 2 comments · Fixed by #5997
Closed

[BUG] Creating no auth data connection fails validaiton #5987

derek-ho opened this issue Feb 29, 2024 · 2 comments · Fixed by #5997
Assignees
Labels
bug Something isn't working multiple datasource multiple datasource project

Comments

@derek-ho
Copy link
Contributor

Describe the bug

Try to create a data connection to a cluster running without security:

You get the following error:


Request payload:
{"dataSourceAttr":{"endpoint":"http://localhost:9201","auth":{"type":"no_auth","credentials":{"username":"","password":"","service":"es"}}}}

Response:
{statusCode: 400, error: "Bad Request",…}
error
: 
"Bad Request"
message
: 
"[request body.dataSourceAttr.auth.credentials]: types that failed validation:\n- [request body.dataSourceAttr.auth.credentials.0.service]: definition for this key is missing\n- [request body.dataSourceAttr.auth.credentials.1.region]: expected value of type [string] but got [undefined]"
statusCode
: 
400

Even though the cluster is reachable:

➜  opensearch-3.0.0-SNAPSHOT curl http://localhost:9201
{
  "name" : "b0f1d89879ca",
  "cluster_name" : "opensearch",
  "cluster_uuid" : "jz2tgeuDTk6XgiDEerKtMw",
  "version" : {
    "distribution" : "opensearch",
    "number" : "3.0.0-SNAPSHOT",
    "build_type" : "tar",
    "build_hash" : "3125b948029609f354d3153f8ca6391638daefc7",
    "build_date" : "2024-02-29T01:10:41.128733293Z",
    "build_snapshot" : true,
    "lucene_version" : "9.11.0",
    "minimum_wire_compatibility_version" : "2.13.0",
    "minimum_index_compatibility_version" : "2.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

OpenSearch Version
Please list the version of OpenSearch being used.

Dashboards Version
Please list the version of OpenSearch Dashboards being used.

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser and version [e.g. 22]

Additional context

Add any other context about the problem here.

@derek-ho derek-ho added bug Something isn't working untriaged labels Feb 29, 2024
@BionIT
Copy link
Collaborator

BionIT commented Feb 29, 2024

I can reproduce this bug
before creating the data source, click test connection with no auth >> show error
after data source is created, then click test connection >> no error

@BionIT
Copy link
Collaborator

BionIT commented Feb 29, 2024

The error is due to payload validation for test connection, happy to work on it! We need to add tests for this validate endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working multiple datasource multiple datasource project
Projects
None yet
3 participants