# Error 500/502 download the .elser\_model\_2\_linux-x86\_64

**URL:** <https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [November 30, 2024, 1:01am UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249 "2024-11-30T01:01:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian\_Pereyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristian_pereyra/32/126779_2.png) [@Cristian\_Pereyra](https://discuss.elastic.co/u/Cristian_Pereyra)\
**Post date:** [November 30, 2024, 1:01am UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/1 "2024-11-30T01:01:17Z")

</div>

- Arch
  - eck 8.15.2 (now 8.16.1 and same issue)
  - operator: 2.11
  - licence: enterprise

Hello everyone. I am trying to download the `.elser_model_2_linux-x86_64` model from Kibana. I have tried the following two approaches:

1. Using the download option from **Kibana \> Machine Learning \> Trained Models** , I get:

> {"statusCode": 500,"error": "Internal Server Error","message": "Request timed out"}

1. Following the reference [ELSER – Elastic Learned Sparse EncodeR | Machine Learning in the Elastic Stack [8.15] | Elastic](https://www.elastic.co/guide/en/machine-learning/8.15/ml-nlp-elser.html#download-deploy-elser), I attempted:

```auto
PUT _inference/sparse_embedding/my-elser-model
 {
 "service": "elser",
  "service_settings": {
 "num_allocations": 1,
     "num_threads": 1
 }
 }

and

PUT _ml/trained_models/.elser_model_2
{
  "input": {
	"field_names": ["message"]
  }
}

```

But I receive this response:

> {"statusCode": 502,"error": "Bad Gateway","message": "Client request timeout"}

From this second approach, the Kibana logs show the following:

> [2024-11-26T23:41:45.573+00:00][ERROR][plugins.console] Error: Client request timeout  
> at Timeout.\_onTimeout (/usr/share/kibana/node\_modules/@kbn/console-plugin/server/lib/proxy\_request.js:91:37)  
> at listOnTimeout (node:internal/timers:573:17)  
> at processTimers (node:internal/timers:514:7)  
> [2024-11-26T23:41:45.574+00:00][WARN][plugins.console] Could not connect to any configured ES node [[https://eck-observabilidad-test-es-http.eck8-ob-test.svc:9200](https://eck-observabilidad-test-es-http.eck8-ob-test.svc:9200/)]

On the Elasticsearch side, I don't see any logs. What I understand is that Kibana is not managing to connect to Elasticsearch, which is strange because I can see everything in Elasticsearch from Kibana.My questions are:

1. Is any additional configuration required for Kibana to connect to Elasticsearch when I want to download ELSER?

**Extra detail:**  
From the Kibana pod, using `curl` to `https://eck-observabilidad-test-es-http.eck8-ob-test.svc:9200`, I connect without any issues, and it returns the Elasticsearch JSON response.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f561bc113ffc127602db17f2dc29ffbd910e062.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b2035a4bf8ca6b5a0e753c54bbe11ca49993db81.png)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 30, 2024, 3:12pm UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/2 "2024-11-30T15:12:50Z")

</div>

Hi @Cristian_Pereyra

1. Do you have any machine learning nodes

`GET _cat/nodes?v`

1. Machine Learning is licensed feature have you enabled a trial license

2. do you have a FW in place...  
Have you tried to download the model artifacts manually from you network/ ECK pod to see if you have connectivity?

See here

> **[ELSER – Elastic Learned Sparse EncodeR | Machine Learning in the Elastic...](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html#elser-model-artifacts)**

---

<div class="post-metadata">

**Author:** ![Cristian\_Pereyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristian_pereyra/32/126779_2.png) [@Cristian\_Pereyra](https://discuss.elastic.co/u/Cristian_Pereyra)\
**Post date:** [November 30, 2024, 4:01pm UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/3 "2024-11-30T16:01:29Z")

</div>

@stephenb Thank you for responding.

the answers are:

1. Yes, I have 3 nodes with all roles assigned, including the ML role.

> /\_cluster/settings

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/9/79707b79fcc82a0cfa92e4cb7b6ae980f8e4b997.png)

1. I have an Enterprise license.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f483469baee14e2635492798e64f3dcbfa0d29a4.png)

1. I'll answer separately:

**3.1** Initially, the proxy didn’t allow me to connect from the pod. However, after changing the proxy settings, I was able to download files. For example, I successfully downloaded the metadata file [here](https://ml-models.elastic.co/elser_model_2_linux-x86_64.metadata.json) without any issues (from the pod, to clarify).

**3.2** With 3.1 resolved, I decided to download the model using the [file-based access method](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html#_using_file_based_access). Currently, the model files are stored on my pod (on all three nodes) at the path `${path.home}/config/models/`.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/6/5619e7230200123d20dbdd298f420e80b8d84f2f.png)

Following those instructions, I have done the following:

1. ✅ **Download the model artifact files.**
2. ✅ **Put the files into a `models` subdirectory inside the `config` directory of your Elasticsearch deployment.**
3. ✅ **Point your Elasticsearch deployment to the model directory by adding the following line to the `config/elasticsearch.yml` file:**

```auto
"persistent": {
        "cluster.max_shards_per_node": "3000",
        "xpack.ml.model_repository": "file://${path.home}/config/models/",
        "xpack.monitoring.collection.enabled": "true"
    },

```

1. ✅ **Repeat step 2 and step 3 on all master-eligible nodes.**
2. ✅ **Restart the master-eligible nodes one by one.**
3. ✅ **Navigate to the Trained Models page from the main menu or use the global search field in Kibana. ELSER can be found in the list of trained models.**
4. ✅ **Click the "Add trained model" button, select the ELSER model version you downloaded in step 1 and want to deploy, and click "Download." ❌ The selected model will be downloaded from the model directory where you placed it in step 2.**

( 🚨 Points 4 and 5 were not necessary since they are already covered by the deployment of the StatefulSet.)

This is the issue I’m currently facing.

> In point 7, I am encountering problems. Kibana tries to connect to Elasticsearch but fails, resulting in a 502 error, which I can find in the Kibana logs. I assume this is a Kibana-related issue because the Elasticsearch logs don’t mention anything about it.

This is the configuration that Kibana has, provided by the ECK operator.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/0/8096cb7d80b4f08c7e18e5734b8dcfce1d9d9a99.png)

message error from kibana

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6de880c6d8b8279093e7362364781127be55c066.png)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 30, 2024, 4:09pm UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/4 "2024-11-30T16:09:14Z")

</div>

My suggestion is since you have a valid Enterprise license is to open a support ticket. They'd probably be able to diagnose this fairly quick. I don't see anything obvious at this moment.

---

<div class="post-metadata">

**Author:** ![Cristian\_Pereyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristian_pereyra/32/126779_2.png) [@Cristian\_Pereyra](https://discuss.elastic.co/u/Cristian_Pereyra)\
**Post date:** [November 30, 2024, 4:11pm UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/5 "2024-11-30T16:11:22Z")

</div>

Yes, I thought the same. I wanted to handle them first based on the information available.

Thank you for your time, and I'll let you know how it went. 💪🏻

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 30, 2024, 4:15pm UTC](https://discuss.elastic.co/t/error-500-502-download-the-elser-model-2-linux-x86-64/371249/6 "2024-11-30T16:15:27Z")

</div>

Ohhh check the permissions/ owners of the downloaded files Make sure they are readable by the `elasticsearch` user.

Oh I saw above but that directory is owned by `root` Perhaps the directory should be owned by `elasticsearch` as well
