# Update\_By\_Query not creating task

**URL:** https://discuss.elastic.co/t/update-by-query-not-creating-task/166535
**Category:** Elasticsearch
**Created:** [January 31, 2019, 10:43am UTC](https://discuss.elastic.co/t/update-by-query-not-creating-task/166535 "2019-01-31T10:43:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gtflagship](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@gtflagship](https://discuss.elastic.co/u/gtflagship)
#### Post date: [January 31, 2019, 10:43am UTC](https://discuss.elastic.co/t/update-by-query-not-creating-task/166535/1 "2019-01-31T10:43:47Z")

</div>

When running:  
ubqResponse = ElasticClient.UpdateByQuery(u =\> u  
.Type("entity")  
.Index(IndexName)  
.Query(q =\> ubqquery)  
.WaitForCompletion(false)  
.Slices(ubqslices)  
.Script(script =\> script.Source(ubqscript).Params(ubqparams)));

I then attempt to get the task that should have been created by:

var currentTask = ubqResponse.Task;  
var status = ElasticClient.GetTask(currentTask);

However ocasionally whenever I try to get the task I get the following error in code and in Kibana:

{  
"error": {  
"root\_cause": [  
{  
"type": "resource\_not\_found\_exception",  
"reason": "task [WKeOw\_8eShy-Fvk6lFCWWA:6047942] isn't running and hasn't stored its results"  
}  
],  
"type": "resource\_not\_found\_exception",  
"reason": "task [WKeOw\_8eShy-Fvk6lFCWWA:6047942] isn't running and hasn't stored its results"  
},  
"status": 404  
}

When breakpointing and retrying the Update\_By\_Query with the same properties it works fine.

---

<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: [February 28, 2019, 10:43am UTC](https://discuss.elastic.co/t/update-by-query-not-creating-task/166535/2 "2019-02-28T10:43:54Z")

</div>

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