# Error comes while close jobs in machine learning

**URL:** <https://discuss.elastic.co/t/error-comes-while-close-jobs-in-machine-learning/162139>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [December 26, 2018, 12:22pm UTC](https://discuss.elastic.co/t/error-comes-while-close-jobs-in-machine-learning/162139 "2018-12-26T12:22:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maulish\_Shah](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Maulish\_Shah](https://discuss.elastic.co/u/Maulish_Shah)\
**Post date:** [December 26, 2018, 12:22pm UTC](https://discuss.elastic.co/t/error-comes-while-close-jobs-in-machine-learning/162139/1 "2018-12-26T12:22:54Z")

</div>

currently i started using 14 day trial version to understand the concept of machine learning in elasticsearch but found some problem while closing the created jobs

PUT \_xpack/ml/calendars/planned-outagesq/jobs/jobid1 #createjob

output  
{  
"calendar\_id" : "planned-outagesq",  
"job\_ids" : [  
"jobid1"  
]  
}

while tried to close job  
POST \_xpack/ml/anomaly\_detectors/jobid1/\_close  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "resource\_not\_found\_exception",  
"reason" : "No known job with id 'jobid1'"  
}  
],  
"type" : "resource\_not\_found\_exception",  
"reason" : "No known job with id 'jobid1'"  
},  
"status" : 404  
}

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [January 2, 2019, 3:43pm UTC](https://discuss.elastic.co/t/error-comes-while-close-jobs-in-machine-learning/162139/2 "2019-01-02T15:43:50Z")

</div>

Hey @Maulish_Shah,

Looking at the APIs you are using, you need to use [https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html) to create a job.

You are simply adding a job to a given `calendar` object [https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html) which does not create the job.

---

<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:** [January 30, 2019, 3:43pm UTC](https://discuss.elastic.co/t/error-comes-while-close-jobs-in-machine-learning/162139/3 "2019-01-30T15:43:55Z")

</div>

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