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] Missing Required Property Builder.<variant kind> #611

Open
slemly opened this issue Aug 29, 2023 · 2 comments
Open

[BUG] Missing Required Property Builder.<variant kind> #611

slemly opened this issue Aug 29, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@slemly
Copy link

slemly commented Aug 29, 2023

What is the bug?

When I attempt to make a openSearchClient.indices().get(indexRequest) call with a valid index that should return multiple results, I am met with a MissingRequiredPropertyException from the client.

This bug is nearly identical to the closed issue detailed here - elastic/elasticsearch-java#249.

My setup is almost identical to the setup described in this forum post, the only difference being that my call is a .get() -

String index = "index_a*"; // imagine indexing pattern being 'index_a0, index_a1, index_b0' etc
List<String> indices = new ArrayList<>();
List<ExpandWildcard> wildcards = new ArrayList<>();
wildcards.add(ExpandWildcard.All);
indices.add(index);
GetIndexRequest request = new GetIndexRequest.Builder().expandWildCards(wildcards).index(indices).build();
GetIndexResponse response = openSearchClient.indices.get(request);   // <-- exception thrown here

However, this exception is NOT thrown when I do the following -

String index = "index_a*"; // imagine indexing pattern being 'index_a0, index_a1, index_b0' etc
List<String> indices = new ArrayList<>();
List<ExpandWildcard> wildcards = new ArrayList<>();
wildcards.add(ExpandWildcard.All);
indices.add(index);
GetIndexRequest request = new GetIndexRequest.Builder().expandWildCards(wildcards).index(indices).build();
ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true);
GetIndexResponse response = openSearchClient.indices.get(request);   // <--no exception thrown here
ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(false);

When this is executed, I receive the expected results of the query.
This workaround was recommended by ElasticSearch documentation here.

I suspect that whichever version of the elastic client that operates under the hood in the version I am using (2.6.0) needs to be updated.

How can one reproduce the bug?

I am unsure how to reproduce this consistently, as it is intermittent in occurrence. I have also had it happen with a .index() call on the client, but that went away as I continued to work and I could not get it to be reproduced.

What is the expected behavior?

I expected to see two viable indexes returned in the response to my query.

What is your host/environment?

Mac OS Ventura 3.4.1
OpenSearch Java Client 2.6.0
Java 11
Connected to AWS as described here; can insert indexes and documents without issue

@slemly slemly added bug Something isn't working untriaged labels Aug 29, 2023
@dblock
Copy link
Member

dblock commented Aug 29, 2023

Let's leave Elastic aside. It's likely the same bug. Feel free to turn it into a failing unit/integration test and make a PR with a fix. Please make sure not to look at any non-open source code.

@wbeckler wbeckler added good first issue Good for newcomers and removed untriaged labels Sep 19, 2023
@slemly
Copy link
Author

slemly commented Sep 22, 2023

Let's leave Elastic aside. It's likely the same bug. Feel free to turn it into a failing unit/integration test and make a PR with a fix. Please make sure not to look at any non-open source code.

Sounds good - was not aware they changed their licensing, and will be sure to avoid non-OSS code in my solution. Will work on crafting a fix and a test.

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

No branches or pull requests

3 participants