# I can't cancel task API enrich \_execute

**URL:** <https://discuss.elastic.co/t/i-cant-cancel-task-api-enrich-execute/248681>\
**Category:** Elasticsearch\
**Created:** [September 15, 2020, 1:12pm UTC](https://discuss.elastic.co/t/i-cant-cancel-task-api-enrich-execute/248681 "2020-09-15T13:12:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tornis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tornis/32/47522_2.png) [@Tornis](https://discuss.elastic.co/u/Tornis)\
**Post date:** [September 15, 2020, 1:12pm UTC](https://discuss.elastic.co/t/i-cant-cancel-task-api-enrich-execute/248681/1 "2020-09-15T13:12:42Z")

</div>

Hello guys!

I have a problem and I believe it could be a bug!  
I created an enrichment policy pointing to an alias with 3 indexes. I started the API "\_enrich / policy/checa-fone/\_execute" and the following error is presented:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "transport_serialization_exception",
        "reason" : "Failed to deserialize response from handler [org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler]"
      }
    ],
    "type" : "transport_serialization_exception",
    "reason" : "Failed to deserialize response from handler [org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler]",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "Unknown NamedWriteable [org.elasticsearch.tasks.Task$Status][enrich-policy-execution]"
    }
  },
  "status" : 500
}

```

I tried to cancel the task but it is not canceled preventing the process from being stopped.

Has anyone gone through this experience and could help with this issue?

Thank you!

---

<div class="post-metadata">

**Author:** ![Charles\_Drolet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charles_drolet/32/63494_2.png) [@Charles\_Drolet](https://discuss.elastic.co/u/Charles_Drolet)\
**Post date:** [September 18, 2020, 9:36pm UTC](https://discuss.elastic.co/t/i-cant-cancel-task-api-enrich-execute/248681/2 "2020-09-18T21:36:31Z")

</div>

Hi,  
I have the same problem,  
When executing an enrichment policy with the flag `wait_for_competion=false`,  
I often get the same error afterward when looking if the task is completed from the task API.

---

<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:** [October 16, 2020, 9:36pm UTC](https://discuss.elastic.co/t/i-cant-cancel-task-api-enrich-execute/248681/3 "2020-10-16T21:36:31Z")

</div>

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