Libdjl_torch.so: undefined symbol when loading a machine learning model

We are using OpenSearch and trying to deploy machine learning models on the system and are getting the error. The whole error message is:

/usr/share/opensearch/jdk/bin/java: symbol lookup error: /data/python/lib/python3.11/site-packages/torch/lib/libdjl_torch.so: undefined symbol: _ZN3c108ListType3getERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4Type24SingletonOrSharedTypePtrIS9_E

This occurs when I try and deploy the model in OpenSearch and results in the JVM crashing with no further log messages.

OS: RHEL9 Vm
OpenSearch: v 2.19.1
pyTorch:2.5.1
Python:3.11
PyTorch engine version: 0.31.1

This is a CPU version of the system if that matters.

I am unsure if there is some other dependency or version incompatibility that we are missing on the system that causes the above.

Please let me know if there is anything else I can provide to clear this up.
Thanks again for the help it’s really appreciated!