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

Fix Alerting tool runtime failure on ClassNotFoundException #1741

Conversation

arjunkumargiri
Copy link
Contributor

Description

Fix Alerting tool runtime failure on ClassNotFoundException.

Issues Resolved

java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
	at org.opensearch.commons.alerting.model.Table.<init>(Table.kt) ~[?:?]
	at org.opensearch.ml.engine.tools.SearchAlertsTool.run(SearchAlertsTool.java:74) ~[?:?]
	at org.opensearch.ml.engine.algorithms.agent.MLChatAgentRunner.lambda$runReAct$7(MLChatAgentRunner.java:512) ~[?:?]
	at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) ~[opensearch-core-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.ListenableFuture$1.doRun(ListenableFuture.java:126) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.OpenSearchExecutors$DirectExecutorService.execute(OpenSearchExecutors.java:343) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.ListenableFuture.notifyListener(ListenableFuture.java:120) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.ListenableFuture.lambda$done$0(ListenableFuture.java:112) ~[opensearch-2.11.0.jar:2.11.0]
	at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
	at org.opensearch.common.util.concurrent.ListenableFuture.done(ListenableFuture.java:112) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.BaseFuture.set(BaseFuture.java:160) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.common.util.concurrent.ListenableFuture.onResponse(ListenableFuture.java:141) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.action.StepListener.innerOnResponse(StepListener.java:79) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.core.action.NotifyOnceListener.onResponse(NotifyOnceListener.java:55) ~[opensearch-core-2.11.0.jar:2.11.0]
	at org.opensearch.action.support.TransportAction$1.onResponse(TransportAction.java:113) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.action.support.TransportAction$1.onResponse(TransportAction.java:107) ~[opensearch-2.11.0.jar:2.11.0]
	at org.opensearch.core.action.ActionListener$6.onResponse(ActionListener.java:301) ~[opensearch-core-2.11.0.jar:2.11.0]
	at org.opensearch.core.action.ActionListener$5.onResponse(ActionListener.java:268) ~[opensearch-core-2.11.0.jar:2.11.0]
	at org.opensearch.core.action.ActionListener$5.onResponse(ActionListener.java:268) ~[opensearch-core-2.11.0.jar:2.11.0]
	at org.opensearch.ml.task.MLPredictTaskRunner.predict(MLPredictTaskRunner.java:229) ~[?:?]
	at org.opensearch.ml.task.MLPredictTaskRunner.lambda$executeTask$4(MLPredictTaskRunner.java:193) ~[?:?]
	at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:849) ~[opensearch-2.11.0.jar:2.11.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
	at [java.net](http://java.net/).URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
	at [java.net](http://java.net/).FactoryURLClassLoader.loadClass(URLClassLoader.java:872) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
	... 26 more

Need to exclude annotation jar as it was resulting in failure

org.opensearch.bootstrap.StartupException: java.lang.IllegalStateException: codebase property already set: codebase.annotations -> file:/local/home/arjung/opensearch/opensearch-2.11.0/plugins/opensearch-ml/annotations-13.0.jar, cannot set to file:/local/home/arjung/opensearch/opensearch-2.11.0/plugins/opensearch-ml/annotations-2.21.15.jar

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Comparison is base (bb86968) 68.60% compared to head (2333d52) 68.96%.
Report is 5 commits behind head on feature/agent_framework_dev.

Files Patch % Lines
...nsearch/ml/engine/tools/AbstractRetrieverTool.java 74.19% 14 Missing and 2 partials ⚠️
...a/org/opensearch/ml/engine/tools/VectorDBTool.java 0.00% 11 Missing ⚠️
...g/opensearch/ml/engine/tools/NeuralSparseTool.java 86.48% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             feature/agent_framework_dev    #1741      +/-   ##
=================================================================
+ Coverage                          68.60%   68.96%   +0.36%     
- Complexity                          2591     2610      +19     
=================================================================
  Files                                239      241       +2     
  Lines                              12757    12815      +58     
  Branches                            1284     1288       +4     
=================================================================
+ Hits                                8752     8838      +86     
+ Misses                              3404     3371      -33     
- Partials                             601      606       +5     
Flag Coverage Δ
ml-commons 68.96% <73.33%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arjunkumargiri arjunkumargiri marked this pull request as ready for review December 7, 2023 21:02
@@ -48,7 +48,9 @@ dependencies {
implementation("ai.djl.onnxruntime:onnxruntime-engine:0.21.0") {
exclude group: "com.microsoft.onnxruntime", module: "onnxruntime"
}
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
implementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}") {
exclude group: "org.jetbrains", module: "annotations"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] can we add a comment why are we excluding this? I saw in the PR description, but I think better to add here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge this PR to unblock the testing, @arjunkumargiri you can add some comments in next PR

@ylwu-amzn ylwu-amzn merged commit 44118ef into opensearch-project:feature/agent_framework_dev Dec 8, 2023
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants