-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] NullPointerException in multi_terms query #7089
Comments
Is this a dup of #5785? It would be amazing if you could help us turn this into a failing unit test. Let's fix it. |
@z002Holpp Check out YAML tests and try to contribute one that reproduces this problem? The reduce the query to a bare minimum that causes the issue to happen. Make a pull request with that. https://github.com/opensearch-project/OpenSearch/blob/main/TESTING.md#testing-the-rest-layer is a good place to start. |
I am going to close this one as a dup of #5785. It does have something closer to a repro, so I'm glad you reported it, thank you! |
I unfortunately have little time to familiarize myself with the technology stack and the domain knowledge. I was hoping that I could support here more from a consumer perspective. |
@z002Holpp MetricBeat 7.12.1 uses docType to bulk ingest which is not supported on OpenSearch 2.2 or 2.6. I am guessing you have not discovered this because you are using ElasticSearch 8.7.0? If you are using OpenSearch, how are you getting around #3484 ? |
@austintlee Hi, thanks for mentioning that! We do not use ElasticSearch, we use only OpenSearch. At least from my side, I did not see the bug / exception mentioned in #3484. |
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
@penghuo when you get a chance, can you review these changes? |
I had a lot of trouble writing the unit test for this because constructing a MultiTermsAggregator object was quite tricky if you have to mock some of the members of the object. But I didn't think I could do much better than what you see in that PR. Please let me know what you think. |
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
…-project#7089) Signed-off-by: Austin Lee <[email protected]>
…search-project#7089) Signed-off-by: Austin Lee <[email protected]>
) * Implement buildEmptyAggregations for MultiTermsAggregator (#7089) Signed-off-by: Austin Lee <[email protected]> * Address Spotless check issue Signed-off-by: Austin Lee <[email protected]> * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (#7089) Signed-off-by: Austin Lee <[email protected]> * Update changelog Update version check and reason Signed-off-by: Austin Lee <[email protected]> --------- Signed-off-by: Austin Lee <[email protected]>
) * Implement buildEmptyAggregations for MultiTermsAggregator (#7089) Signed-off-by: Austin Lee <[email protected]> * Address Spotless check issue Signed-off-by: Austin Lee <[email protected]> * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (#7089) Signed-off-by: Austin Lee <[email protected]> * Update changelog Update version check and reason Signed-off-by: Austin Lee <[email protected]> --------- Signed-off-by: Austin Lee <[email protected]> (cherry picked from commit 86f955c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) * Implement buildEmptyAggregations for MultiTermsAggregator (#7089) Signed-off-by: Austin Lee <[email protected]> * Address Spotless check issue Signed-off-by: Austin Lee <[email protected]> * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (#7089) Signed-off-by: Austin Lee <[email protected]> * Update changelog Update version check and reason Signed-off-by: Austin Lee <[email protected]> --------- Signed-off-by: Austin Lee <[email protected]> (cherry picked from commit 86f955c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <[email protected]>
) (#8333) * Implement buildEmptyAggregations for MultiTermsAggregator (#7089) * Address Spotless check issue * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (#7089) * Update changelog Update version check and reason --------- (cherry picked from commit 86f955c) Signed-off-by: Austin Lee <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…-project#7089) (opensearch-project#7318) * Implement buildEmptyAggregations for MultiTermsAggregator (opensearch-project#7089) Signed-off-by: Austin Lee <[email protected]> * Address Spotless check issue Signed-off-by: Austin Lee <[email protected]> * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (opensearch-project#7089) Signed-off-by: Austin Lee <[email protected]> * Update changelog Update version check and reason Signed-off-by: Austin Lee <[email protected]> --------- Signed-off-by: Austin Lee <[email protected]>
…-project#7089) (opensearch-project#7318) * Implement buildEmptyAggregations for MultiTermsAggregator (opensearch-project#7089) Signed-off-by: Austin Lee <[email protected]> * Address Spotless check issue Signed-off-by: Austin Lee <[email protected]> * Add a unit test for MultiTermsAggregator.buildEmptyAggregations (opensearch-project#7089) Signed-off-by: Austin Lee <[email protected]> * Update changelog Update version check and reason Signed-off-by: Austin Lee <[email protected]> --------- Signed-off-by: Austin Lee <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Hi all,
we want to use OpenSearch for querying our systems to get aggregated system information like CPU and RAM usage.
Therefore we use date historgram aggregation. Since we want to have those measures for different hosts / containers / processes we need also a kind of grouping mechanism which we tried to realize with the
multi_terms
feature.Our initial query was looking like this:
However this query results in the following execption:
java.lang.NullPointerException: Cannot invoke \"org.opensearch.common.io.stream.NamedWriteable.getWriteableName()\" because \"namedWriteable\" is null
If needed I can also provide the full error response, but for me it seems not to contain much more meaningful information.
The query runs fine if the
multi_terms
part is removed, leaving onlyI also tried to minimize the query in order to isolate the issue and it came out that the following query will still produce the error:
Important Note: The queries were tested with ElasticSearch 8.7.0 and they worked as expected. So the queries themsselves can be considered to be correct.
Thank you already in advance for your help! :slight_smile:
To Reproduce
Have an OpenSearch Instance with MetricBeat and run the above query.
Expected behavior
The query runs and returns zero or more results, depending on the data in OpenSearch. However, there shall not be a Nullpointer Exception.
Plugins
MetricBeat
Host/Environment (please complete the following information):
OpenSearch Version used: 2.2.0 & 2.6.0
MetricBeat: 2.7.12.1
The text was updated successfully, but these errors were encountered: