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] ExplainRequest does not work properly #281

Closed
zethuman opened this issue Apr 5, 2023 · 4 comments · Fixed by #286
Closed

[BUG] ExplainRequest does not work properly #281

zethuman opened this issue Apr 5, 2023 · 4 comments · Fixed by #286
Labels
bug Something isn't working

Comments

@zethuman
Copy link
Contributor

zethuman commented Apr 5, 2023

What is the bug?

ExplainRequest return error with empty structure without details.

How can one reproduce the bug?

Now, I am writing test cases to the document APIs #280 and found this problem. However I can not identify it.

To reproduce bug, create index, create document with id "2" and request Explain API

r: opensearchapi.ExplainRequest{
  Index:      index,
  DocumentID: "2",
  Body:       strings.NewReader(`{ "query": { "match": {"year": "2019" } } }`),
  Human:      true,
  ErrorTrace: true,
},

I got this:

Do() error = error: {[]    }, status: 0, wantErr false
    --- FAIL: TestUpdateRequest_Do/TestExplainRequest_Do (0.00s)

What is the expected behavior?

At least details of error, even better successfully found document

What is your host/environment?

MacOS Ventura

Do you have any screenshots?

image

@zethuman zethuman added bug Something isn't working untriaged labels Apr 5, 2023
@Jakob3xD
Copy link
Collaborator

Jakob3xD commented Apr 7, 2023

The empty error body is caused by a 404 without a error body. The request returns following instead of an expected error response:

{"_index":"index-2023-04-07-03-57-18","_id":"2","matched":false}

Need to check if this is wanted from opensearch and if so fix the error handling to return the non-parsed error.

@Jakob3xD
Copy link
Collaborator

The incorrect error response is fixed but the test added by #285 is not working correctly.
lt. comment the explain api returns 200 without a body.
#285 (comment)

@Jakob3xD Jakob3xD reopened this Apr 12, 2023
@zethuman
Copy link
Contributor Author

Yes, it turns out I didn’t report it, I even tried to update the indexes before calling, it doesn’t help

@Jakob3xD
Copy link
Collaborator

Should no longer be relevant with #421 merged. Please reopen if the issue sill persists.

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

Successfully merging a pull request may close this issue.

3 participants