# Machine Learning error when creating and openning new Job

**URL:** https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325
**Category:** Elasticsearch
**Tags:** elastic-stack-machine-learning
**Created:** [June 5, 2019, 10:03am UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325 "2019-06-05T10:03:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanfr84](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jonathanfr84](https://discuss.elastic.co/u/jonathanfr84)
#### Post date: [June 5, 2019, 10:03am UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325/1 "2019-06-05T10:03:23Z")

</div>

Hello,

I've installed a metricbeat which is garthering information about a linux system and I want to try the machine learning forecast feautre using the index generated by metricbeat.

I've created a Job using the metricbeat index and a field (for example disk usage) but when I create the job and it tries to be openned, I'm getting the following error:

```
Unexpected job state [failed] while waiting for job to be opened

 Less Info
OK
Error: "{\"error\":{\"root_cause\":[{\"type\":\"exception\",\"reason\":\"Unexpected job state [failed] while waiting for job to be opened\"}],\"type\":\"exception\",\"reason\":\"Unexpected job state [failed] while waiting for job to be opened\"},\"status\":500}"
    at Object.errorNotify [as error] (https://[ELK_HOST]/bundles/ml.bundle.js:2:61134)
    at https://[ELK_HOST]/bundles/ml.bundle.js:2:107552
    at Array.forEach (<anonymous>)
    at showResults (https://[ELK_HOST]/bundles/ml.bundle.js:2:107485)
    at https://[ELK_HOST]/bundles/ml.bundle.js:2:104924

```

If I try to run datafeed it fails with the same problem because the job can't be openned.

The version of ELK Stack is 7.0 and ML is activated.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [June 5, 2019, 11:38am UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325/2 "2019-06-05T11:38:44Z")

</div>

since you are on 7.0 there's an easy way to find out what the problem is, as a benefit from this recent addition: [https://github.com/elastic/elasticsearch/pull/38029](https://github.com/elastic/elasticsearch/pull/38029)

call `_cluster/state?pretty` in a web browser (against any node), then look for the `"persistent_tasks"` section, and find the task whose name includes the job name then it should include the detailed failure reason.

---

<div class="post-metadata">

### Author: ![jonathanfr84](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jonathanfr84](https://discuss.elastic.co/u/jonathanfr84)
#### Post date: [June 5, 2019, 12:45pm UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325/3 "2019-06-05T12:45:01Z")

</div>

Thanks for your response richcollier. I've tried what you said and I got the following:

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

Unfortunately, tasks section is empty so I can't find any extra information. Do you know something more I can try? Meanwhile I'll continue investigating.

Thanks!

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [June 6, 2019, 10:38am UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325/4 "2019-06-06T10:38:56Z")

</div>

Seems like the best thing to do is to try to do it again, but this time - try to find the appropriate ML-related error message that is written to `elasticsearch.log` on the node that attempted to open the ML job. If you have more than one node, you'll have to go to each node to find which one tried.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 4, 2019, 10:39am UTC](https://discuss.elastic.co/t/machine-learning-error-when-creating-and-openning-new-job/184325/5 "2019-07-04T10:39:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
