# Errors when deploy ML Models to Opensearch cluster

**URL:** <https://forum.opensearch.org/t/errors-when-deploy-ml-models-to-opensearch-cluster/19934>\
**Category:** OpenSearch\
**Created:** [June 20, 2024, 7:11pm UTC](https://forum.opensearch.org/t/errors-when-deploy-ml-models-to-opensearch-cluster/19934 "2024-06-20T19:11:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tao1](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@Tao1](https://forum.opensearch.org/u/Tao1)\
**Post date:** [June 20, 2024, 7:11pm UTC](https://forum.opensearch.org/t/errors-when-deploy-ml-models-to-opensearch-cluster/19934/1 "2024-06-20T19:11:43Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

opensearch-2.10.0

**Describe the issue** :

When trying to deploy a ML Model - all-MiniLM-L6-v2\_torchscript\_sentence-transformer.zip to a Opensearch cluster, deployment errored out with following -

“model\_id”: “Jg8BN5ABuctAWnb9HkNM”,  
“task\_type”: “DEPLOY\_MODEL”,  
“function\_name”: “TEXT\_EMBEDDING”,  
“state”: “FAILED”,  
“worker\_node”: [  
“TINBM5k4SAmLgccLRqWh-g”,  
“ezXgFqZfQMuLWK7NuT38ww”,  
“QcU9XVpeSN27JRqo7qHlTw”  
],  
“create\_time”: 1718909826109,  
“last\_update\_time”: 1718909828811,  
“error”: “”“{“TINBM5k4SAmLgccLRqWh-g”:“Network is unreachable”,“ezXgFqZfQMuLWK7NuT38ww”:“Network is unreachable”,“QcU9XVpeSN27JRqo7qHlTw”:“Network is unreachable”}”“”,  
“is\_async”: true

**Configuration** :  
The all-MiniLM-L6-v2\_torchscript\_sentence-transformer.zip was downloaded to a local file and registered using opensearch\_py\_ml successfully. but with a “not responding” status and the errors was “Network is unreachable”.

Is this because the Model somehow has to go out to a public internet URL? The opensearch cluster hosted internal network and has no internet access.

**Relevant Logs or Screenshots** :  
model\_path = “all-MiniLM-L6-v2\_torchscript\_sentence-transformer.zip”  
model\_config\_path = “sentence-transformer.json”  
model\_id\_file\_system = ml\_client.register\_model(model\_path, model\_config\_path, isVerbose=True)

model\_path = “all-MiniLM-L6-v2\_torchscript\_sentence-transformer.zip”  
model\_config\_path = “sentence-transformer.json”  
model\_id\_file\_system = ml\_client.register\_model(model\_path, model\_config\_path, isVerbose=True)

Task status -  
{  
“model\_id”: “Jg8BN5ABuctAWnb9HkNM”,  
“task\_type”: “DEPLOY\_MODEL”,  
“function\_name”: “TEXT\_EMBEDDING”,  
“state”: “FAILED”,  
“worker\_node”: [  
“TINBM5k4SAmLgccLRqWh-g”,  
“ezXgFqZfQMuLWK7NuT38ww”,  
“QcU9XVpeSN27JRqo7qHlTw”  
],  
“create\_time”: 1718909826109,  
“last\_update\_time”: 1718909828811,  
“error”: “”“{“TINBM5k4SAmLgccLRqWh-g”:“Network is unreachable”,“ezXgFqZfQMuLWK7NuT38ww”:“Network is unreachable”,“QcU9XVpeSN27JRqo7qHlTw”:“Network is unreachable”}”“”,  
“is\_async”: true  
}

[2024-06-20T14:57:08,809][ERROR][o.o.m.m.MLModelManager] [] Failed to retrieve model Jg8BN5ABuctAWnb9HkNM  
org.opensearch.ml.common.exception.MLException: Failed to deploy model Jg8BN5ABuctAWnb9HkNM  
at org.opensearch.ml.engine.algorithms.DLModel.lambda$loadModel$1(DLModel.java:275) ~[?:?]  
at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]  
at org.opensearch.ml.engine.algorithms.DLModel.loadModel(DLModel.java:187) ~[?:?]  
at org.opensearch.ml.engine.algorithms.DLModel.initModel(DLModel.java:135) ~[?:?]  
at org.opensearch.ml.engine.MLEngine.deploy(MLEngine.java:125) ~[?:?]  
at org.opensearch.ml.model.MLModelManager.lambda$deployModel$35(MLModelManager.java:804) ~[?:?]  
at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-2.10.0.jar:2.10.0]  
at org.opensearch.ml.model.MLModelManager.lambda$retrieveModelChunks$41(MLModelManager.java:924) [opensearch-ml-2.10.0.0.jar:2.10.0.0]  
at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-2.10.0.jar:2.10.0]  
at org.opensearch.action.support.ThreadedActionListener$1.doRun(ThreadedActionListener.java:78) [opensearch-2.10.0.jar:2.10.0]  
at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:908) [opensearch-2.10.0.jar:2.10.0]  
at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) [opensearch-2.10.0.jar:2.10.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: ai.djl.engine.EngineException: Failed to save pytorch index file  
at ai.djl.pytorch.jni.LibUtils.downloadPyTorch(LibUtils.java:403) ~[?:?]  
at ai.djl.pytorch.jni.LibUtils.findNativeLibrary(LibUtils.java:286) ~[?:?]  
at ai.djl.pytorch.jni.LibUtils.getLibTorch(LibUtils.java:89) ~[?:?]  
at ai.djl.pytorch.jni.LibUtils.loadLibrary(LibUtils.java:77) ~[?:?]  
at ai.djl.pytorch.engine.PtEngine.newInstance(PtEngine.java:53) ~[?:?]  
at ai.djl.pytorch.engine.PtEngineProvider.getEngine(PtEngineProvider.java:40) ~[?:?]  
at ai.djl.engine.Engine.getEngine(Engine.java:187) ~[?:?]  
at org.opensearch.ml.engine.algorithms.DLModel.lambda$loadModel$1(DLModel.java:220) ~[?:?]  
… 14 more  
Caused by: java.net.SocketException: Network is unreachable  
at sun.nio.ch.Net.connect0(Native Method) ~[?:?]

Thanks in advance for the help!

---

<div class="post-metadata">

**Author:** ![yeonghyeonKo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/yeonghyeonko/32/8202_2.png) [@yeonghyeonKo](https://forum.opensearch.org/u/yeonghyeonKo)\
**Post date:** [July 24, 2024, 7:15am UTC](https://forum.opensearch.org/t/errors-when-deploy-ml-models-to-opensearch-cluster/19934/2 "2024-07-24T07:15:11Z")

</div>

I’m dealing with this problem very similar with yours.

> [@How can we deploy ML model (.zip) to nodes locally, not via SSL or the firewall](https://forum.opensearch.org/t/how-can-we-deploy-ml-model-zip-to-nodes-locally-not-via-ssl-or-the-firewall/20438):
>
> Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.15.0 (both OpenSearch and its Dashboards) Kubernetes 1.25.6 Controlled by OpenSearch Operator (2.5.1) Describe the issue: PUT /\_cluster/settings { "persistent": { "plugins.ml\_commons.allow\_registering\_model\_via\_url": true } } POST /\_plugins/\_ml/models/\_register { "name": "all-MiniLM-L6-v2", "version": "1.0.0", "description": "test model", "model\_format": "TORCH\_SCRIPT", "model\_group\_id": "03jj2ZABhH7…

The model has been registered successfully using locally downloaded file but couldn’t be deployed to ML nodes. ( **not responding** status)

Did you find any solution? I think your issue is caused by firewall blocking network connection between your environment and public Internet.
