-
Notifications
You must be signed in to change notification settings - Fork 138
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] Class Cast Exception when invoking Register API through MLClient #1553
Comments
I wonder if this code has any relevance here. |
ml-commons might not be the right place for this issue. I think you need to find exactly what those two classloaders are to get to the bottom of this. Does this happen if you use 2.x? |
Just tested on 2.x as well. Failed with the same error
|
Tried invoking registerModelGroup API which doesn't have the actionListener wrapper while invoking Logs:
|
So the exception is thrown on this instantiation: Line 68 in 8c3e453
The context for the Action Listener is set (or, rather, restored) here: ml-commons/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java Lines 67 to 68 in 8c3e453
|
@owaiskazi19 I see that you were the one who added this API to MLClient (#1493). Is it possible that you have some old jar sitting on your machine? Does this happen on anyone else's machine or is this happening in a "fresh" environment? |
@joshpalis faced the same issue for register API and created opensearch-project/flow-framework#108. Also, I cleaned everything, spun up a new OS 3.0 cluster and installed the ml-commons and ai-flow-framework plugin. Still failed with the same issue. I think what @dbwiddis pointed out above about the context of ActionListener can be the reason for the CastException. |
#1560 solved the Class Cast Exception for register API! Thanks @ylwu-amzn |
@owaiskazi19 Do we know why |
Same JAR, different class loaders. Also for clarity the conflict is in the My suspicion is that plugin class loaders are children of the OpenSearch parent; so they share classes with OpenSearch but don't share classes with each other. I have not delved into the specific details, but the linked issues and PRs demonstrate an effective fix. |
As @dbwiddis pointed out. We were fetching |
What is the bug?
Getting a class cast exception as mentioned below using the register API of MLClient in our plugin. Two class loaders are getting loaded in the cluster
whereas our plugin is importing
MLRegisterModelResponse
just once from the locationCode:
COMPLETE ERROR:
Found a PR similar to this issue already addressed Class Cast Exception: #127
How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
Register API should return MLRegisterModelResponse without any exception.
What is your host/environment?
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
opensearch-project/flow-framework#108
The text was updated successfully, but these errors were encountered: