# Unable to delete a failed job in Machine Learning Beta

**URL:** <https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [August 21, 2017, 10:22am UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747 "2017-08-21T10:22:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nktvys](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@nktvys](https://discuss.elastic.co/u/nktvys)\
**Post date:** [August 21, 2017, 10:22am UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/1 "2017-08-21T10:22:58Z")

</div>

Hi,

I want to delete a failed job.

 ![46 pm](https://us1.discourse-cdn.com/elastic/original/3X/2/4/242a23a20b2a78c457411c315e5ff0638a17e745.png)

A pop-up appears and an error is displayed.

![36 pm](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a8e08c2ee71bea52af43975469db7cb659e8273a.png)

 ![26 pm](https://us1.discourse-cdn.com/elastic/original/3X/1/3/1362e7fe697f444ec581b790f510f1f18a74a684.png)

The stopping and deleting datafeed fails because the datafeed was already deleted when I tried to delete it the job the first time.

 ![04 pm](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5fb2f142c0799f6e3ba370c8c5a43e81f669bf04.png)

I recently started using Kibana and can't figure out how to delete it even after reading through topics in the forum. Please help me solve this.

---

<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:** [August 23, 2017, 1:08pm UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/2 "2017-08-23T13:08:45Z")

</div>

What happens if you manually try to stop the Datafeed ([https://www.elastic.co/guide/en/x-pack/5.4/ml-stop-datafeed.html](https://www.elastic.co/guide/en/x-pack/5.4/ml-stop-datafeed.html))

`POST _xpack/ml/datafeeds/<feed_id>/_stop`

and/or try to manually delete the Datafeed ([https://www.elastic.co/guide/en/x-pack/5.4/ml-delete-datafeed.html](https://www.elastic.co/guide/en/x-pack/5.4/ml-delete-datafeed.html))

`DELETE _xpack/ml/datafeeds/<feed_id>`

What are the replies to the above API calls? Is there other interesting info in the elasticsearch.log when trying to invoke the above?

If neither of these are successful, perhaps restarting elasticsearch may help?

---

<div class="post-metadata">

**Author:** ![nktvys](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@nktvys](https://discuss.elastic.co/u/nktvys)\
**Post date:** [August 24, 2017, 5:59am UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/3 "2017-08-24T05:59:25Z")

</div>

Hi Rich,

The datafeed was stopped and deleted successfully when I tried to delete the job. Only the jobs won't delete.

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:** [August 25, 2017, 7:22pm UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/4 "2017-08-25T19:22:14Z")

</div>

Ok, thanks for the clarification. If executing a force delete on the job (**[https://www.elastic.co/guide/en/elasticsearch/reference/5.5/ml-delete-job.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/ml-delete-job.html))**

`DELETE _xpack/ml/anomaly_detectors/<job_id>force=true`

If that doesn't fix things then see if there are any hung ML processes. Usins `ps` on the box, grep for the `autodetect` process - this is the C++ process that runs the ML code. If there are still remnant processes, still running, then kill them and then delete the job.

---

<div class="post-metadata">

**Author:** ![nktvys](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@nktvys](https://discuss.elastic.co/u/nktvys)\
**Post date:** [August 30, 2017, 12:24pm UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/5 "2017-08-30T12:24:57Z")

</div>

I updated Kibana to 5.5.2 and it solved the issue.  
Thanks Rich! 😃

---

<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:** [September 27, 2017, 12:24pm UTC](https://discuss.elastic.co/t/unable-to-delete-a-failed-job-in-machine-learning-beta/97747/6 "2017-09-27T12:24:58Z")

</div>

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