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] Error not deserializable for invalid alias in alias request #480

Closed
patschl opened this issue May 14, 2023 · 2 comments
Closed

[BUG] Error not deserializable for invalid alias in alias request #480

patschl opened this issue May 14, 2023 · 2 comments
Labels
bug Something isn't working untriaged

Comments

@patschl
Copy link
Contributor

patschl commented May 14, 2023

What is the bug?

When executing an alias request with a non-existing alias (GET /_alias/alias1) the error response cannot be deserialized as a JSON object is expected, but the response contains only a string for the error field.
An UnexpectedJsonEventException is thrown:
org.opensearch.client.json.UnexpectedJsonEventException: Unexpected JSON event 'VALUE_STRING' instead of '[START_OBJECT, KEY_NAME]' because the response looks like this:

{
  "error" : "alias [nonExistingAlias] missing",
  "status" : 404
}

How can one reproduce the bug?

Request indices for a non-existing alias:
openSearch.indices().getAlias { request -> request.name("nonExistingAlias") }

What is the expected behaviour?

The error response will be deserialized correctly.

What is your host/environment?

AWS OpenSearch 1.2

Do you have any additional context?

I'm not quite sure who's at fault here since the error response is very inconsistent.
When doing it the other way around by requesting the aliases for an index (GET /index-1/_alias) the error message looks correct with the error being a JSON object containing the root cause, which the deserializer also expects in this case.

@patschl patschl added bug Something isn't working untriaged labels May 14, 2023
@szczepanczykd
Copy link
Collaborator

Hello @patschl,

this issue is a duplicate of: #301

Please try the latest SNAPSHOT release:
#301 (comment)

@patschl
Copy link
Contributor Author

patschl commented May 15, 2023

Sorry, my bad!
Thank you very much.

@patschl patschl closed this as completed May 15, 2023
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
Development

No branches or pull requests

2 participants