Cannot upload ML model

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

2.6.0

Describe the issue:
When trying to upload a ML model with:

POST /_plugins/_ml/models/_upload
{
  "name": "all-MiniLM-L6-v2",
  "version": "1.0.0",
  "description": "test model",
  "model_format": "TORCH_SCRIPT",
  "model_config": {
    "model_type": "bert",
    "embedding_dimension": 384,
    "framework_type": "sentence_transformers"
  },
  "url": "https://github.com/opensearch-project/ml-commons/blob/2.x/ml-algorithms/src/test/resources/org/opensearch/ml/engine/algorithms/text_embedding/all-MiniLM-L6-v2_torchscript_sentence-transformer.zip?raw=true"
}

or

POST /_plugins/_ml/models/_upload
{
  "name": "huggingface/sentence-transformers/all-MiniLM-L12-v2",
  "version": "1.0.1",
  "model_format": "TORCH_SCRIPT"
}

I am getting the following error:

[2023-03-31T13:54:02,411][INFO ][o.o.m.m.MLModelManager   ] [opensearch-node1] create new model meta doc FGTyN4cB1jpe-rBkWggX for upload task E2TyN4cB1jpe-rBkWQjm
[2023-03-31T13:54:02,424][ERROR][o.o.m.m.MLModelManager   ] [opensearch-node1] Failed to index chunk file
java.security.PrivilegedActionException: null
	at java.security.AccessController.doPrivileged(AccessController.java:573) ~[?:?]
	at org.opensearch.ml.engine.ModelHelper.downloadAndSplit(ModelHelper.java:147) [opensearch-ml-algorithms-2.6.0.0.jar:?]
	at org.opensearch.ml.model.MLModelManager.uploadModel(MLModelManager.java:268) [opensearch-ml-2.6.0.0.jar:2.6.0.0]
	at org.opensearch.ml.model.MLModelManager.lambda$uploadModelFromUrl$3(MLModelManager.java:241) [opensearch-ml-2.6.0.0.jar:2.6.0.0]
	at org.opensearch.action.ActionListener$1.onResponse(ActionListener.java:80) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.action.support.ThreadedActionListener$1.doRun(ThreadedActionListener.java:78) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:806) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) [opensearch-2.6.0.jar:2.6.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.net.UnknownHostException: github.com
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2048) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2043) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:2042) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1609) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) ~[?:?]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) ~[?:?]
	at ai.djl.training.util.DownloadUtils.download(DownloadUtils.java:78) ~[?:?]
	at ai.djl.training.util.DownloadUtils.download(DownloadUtils.java:52) ~[?:?]
	at org.opensearch.ml.engine.ModelHelper.lambda$downloadAndSplit$2(ModelHelper.java:153) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]
	... 10 more
Caused by: java.net.UnknownHostException: github.com
	at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[?:?]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]
	at java.net.Socket.connect(Socket.java:633) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174) ~[?:?]
	at sun.net.NetworkClient.doConnect(NetworkClient.java:183) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266) ~[?:?]
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380) ~[?:?]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128) ~[?:?]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3236) ~[?:?]
	at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:637) ~[?:?]
	at java.net.URLConnection.getContentLengthLong(URLConnection.java:509) ~[?:?]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLengthLong(HttpsURLConnectionImpl.java:372) ~[?:?]
	at ai.djl.training.util.DownloadUtils.download(DownloadUtils.java:73) ~[?:?]
	at ai.djl.training.util.DownloadUtils.download(DownloadUtils.java:52) ~[?:?]
	at org.opensearch.ml.engine.ModelHelper.lambda$downloadAndSplit$2(ModelHelper.java:153) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]
	... 10 more

Configuration:

Can maybe somebody help if I am missing some configuration. The user has ml_full_access role and an admin role already. I am running OpenSearch behind corporate proxy, but the proxy is configure through env variables. Should I configure something else as well?
Thank you in advance!

Relevant Logs or Screenshots:

It seems the problem is somehow connected with the security plugin. You can try setting plugins.security.disabled: true. Let me know if it helps.

I’m not sure if it is recommended leaving it that way, but it might work until you figure out the root cause.

@alibizhenis Sorry that missed this question. I tried on 2.6 version, I can upload model successfully. From the log seems some network issue: Caused by: java.net.UnknownHostException: github.com.