Command 'ASSIGN' rejected with code 'NOT_FOUND': Expected to assign user task with key, but no such user task was found

Camunda 8.6.10 configured with tenants. A local installation with Kind K8s cluster using official Helm charts. The Zeebe and Operate work as expected.

But the Tasklist not.

The task is in the Tasklist visible:

However if you try to assign it, it is not possible and in the log of the tasklist pod we can see the following:
Command 'ASSIGN' rejected with code 'NOT_FOUND': Expected to assign user task with key, but no such user task was found

What is the problem?

@Adam_Boczek While modeling the user task have you configured the task type as “Job Worker” or “Zeebe/Camunda User Task” ?

For job worker based user task you need to use tasklist v1 api’s and for “Zeebe/Camunda User task” use tasklist v2 api.

It is a ZEEBE_USER_TASK according to the information we get over the API:

GET http://localhost:8082/v1/tasks/2251799813686176

HTTP/1.1 200 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self';connect-src 'self' https: *.mixpanel.com cloudflareinsights.com *.appcues.net wss://api.appcues.net;script-src 'self' https: *.chargebee.com *.mixpanel.com ajax.cloudflare.com static.cloudflareinsights.com;style-src 'self' https: 'unsafe-inline' *.googleapis.com *.chargebee.com;img-src * data: ;font-src 'self' data: https://fonts.gstatic.com https://fonts.camunda.io;frame-ancestors;frame-src 'self' https: *.chargebee.com ;child-src;worker-src 'self' blob:;base-uri 'self';form-action 'self';object-src 'none';script-src-attr 'none';
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Mar 2025 11:18:28 GMT

{
  "id": "2251799813686176",
  "name": "Ship order",
  "taskDefinitionId": "ShipOrder_Task",
  "processName": "Ship Order",
  "creationDate": "2025-03-07T07:23:01.646+0000",
  "completionDate": null,
  "assignee": null,
  "taskState": "CREATED",
  "formKey": "2251799813686110",
  "formId": "ShipOrderInputTrackingDataForm",
  "formVersion": 2,
  "isFormEmbedded": false,
  "processDefinitionKey": "2251799813686109",
  "processInstanceKey": "2251799813686163",
  "tenantId": "adam-test",
  "dueDate": null,
  "followUpDate": null,
  "candidateGroups": null,
  "candidateUsers": null,
  "implementation": "ZEEBE_USER_TASK",
  "priority": 50
}

Calling the API directly causes the same error as listed in log:

POST http://localhost:8082/v2/user-tasks/2251799813686176/completion

HTTP/1.1 404 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self';connect-src 'self' https: *.mixpanel.com cloudflareinsights.com *.appcues.net wss://api.appcues.net;script-src 'self' https: *.chargebee.com *.mixpanel.com ajax.cloudflare.com static.cloudflareinsights.com;style-src 'self' https: 'unsafe-inline' *.googleapis.com *.chargebee.com;img-src * data: ;font-src 'self' data: https://fonts.gstatic.com https://fonts.camunda.io;frame-ancestors;frame-src 'self' https: *.chargebee.com ;child-src;worker-src 'self' blob:;base-uri 'self';form-action 'self';object-src 'none';script-src-attr 'none';
Content-Type: application/problem+json
Transfer-Encoding: chunked
Date: Mon, 10 Mar 2025 11:45:16 GMT

{
  "type": "about:blank",
  "title": "NOT_FOUND",
  "status": 404,
  "detail": "Command 'COMPLETE' rejected with code 'NOT_FOUND': Expected to complete user task with key '2251799813686176', but no such user task was found",
  "instance": "/v2/user-tasks/2251799813686176/completion"
}

When trying to use v1 of the API we get the hint we should use the new API as tried above:

PATCH http://localhost:8082/v1/tasks/2251799813686176/complete

HTTP/1.1 400 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self';connect-src 'self' https: *.mixpanel.com cloudflareinsights.com *.appcues.net wss://api.appcues.net;script-src 'self' https: *.chargebee.com *.mixpanel.com ajax.cloudflare.com static.cloudflareinsights.com;style-src 'self' https: 'unsafe-inline' *.googleapis.com *.chargebee.com;img-src * data: ;font-src 'self' data: https://fonts.gstatic.com https://fonts.camunda.io;frame-ancestors;frame-src 'self' https: *.chargebee.com ;child-src;worker-src 'self' blob:;base-uri 'self';form-action 'self';object-src 'none';script-src-attr 'none';
Content-Type: application/problem+json
Transfer-Encoding: chunked
Date: Mon, 10 Mar 2025 11:49:28 GMT
Connection: close

{
  "status": 400,
  "message": "This operation is not supported using Tasklist V1 API. Please use the latest API. For more information, refer to the documentation: https://docs.camunda.io/docs/apis-tools/tasklist-api-rest/migrate-to-zeebe-user-tasks/",
  "instance": "bf97e7e3-4d07-475b-a48a-cf8989cfed9d"
}

You should use Tasklist v2 version of api for querying and other task related actions.

Could you share the bpmn model to further check this issue?

With Tasklist v2 api are you able to search the tasks by processInstanceKey?

/v2/user-tasks/search

with payload:

{
    "filter": {
        "processInstanceKey": <processInstanceKey>
    }
}

Hi, thank you for your suggestion, but please take another look at my initial post. The issue is that Camunda’s Tasklist UI can display the tasks, but when I click the “Assign” button, it returns an error. Checking the logs of the Tasklist pod reveals that it is using the correct version (v2) of the API, but it cannot find the requested task (404 error). This problem is related to Camunda’s tooling, not my custom application.