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

[Hookup osd 2.0] AD Dashboards see 400 bad request issue #221

Closed
ananzh opened this issue Mar 31, 2022 · 1 comment · Fixed by #230
Closed

[Hookup osd 2.0] AD Dashboards see 400 bad request issue #221

ananzh opened this issue Mar 31, 2022 · 1 comment · Fixed by #230
Labels
bug Something isn't working untriaged

Comments

@ananzh
Copy link
Member

ananzh commented Mar 31, 2022

Describe the bug
Hook up AD Dashboards with OSD 2.0 see the following error:

{"statusCode":400,"error":"Bad Request","message":"[request body]: expected value of type [any] but got [undefined]"}

Screen Shot 2022-03-30 at 10 07 56 PM

Screen Shot 2022-03-30 at 10 08 36 PM

To Reproduce
Run OpenSearch 2.0 with AD engine 2.0
Clone AD Dashboards current main (v1.3) to OpenSearch Dashboards plugins folder
Modify packages.json (delete the packages that have the compatibility issue):

"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.0.4"

Change opensearchDashboardsVersion to 2.0.0 in opensearch_dashboards.json
Run yarn osd bootstrap and yarn start in OpenSearch Dashboards

Expected behavior
No issue

Plugins
AD

@ananzh ananzh added bug Something isn't working untriaged labels Mar 31, 2022
@ananzh
Copy link
Member Author

ananzh commented Mar 31, 2022

Issue is due to this line here

After typescript upgrade, Dashboards use a more restrict type check. For the get API from AD, we could see body is null.
Screen Shot 2022-03-30 at 9 28 11 PM

Body null is transformed to undefined in the type check in the dashboards. Then, type undefined is no longer acceptable from type any by restricter type check.

There are two ways to change:

  1. Seems request body is always null in get API. Could delete L64.
  2. Change to body: schema.nullable(schema.any()),

Both would solve the issue.

@ananzh ananzh changed the title AD Dashboards hook up with OSD 2.0 see 400 bad request issue [Hookup osd 2.0] AD Dashboards see 400 bad request issue Mar 31, 2022
This was referenced Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
1 participant