UserTasks are getting removed from the Tasklist

Hi,

I’m trying to run a sample workflow, which has user task and there is a job worker which just logs the job details but doesn’t complete the user task. Later there is one API call, when that is made I’m trying to get the user task based on task ID which was logged during User Task worker execution. But I’m getting below exception and later the in TaskList Client, those User tasks are getting removed in the TaskList. And in Operate I see the current state will be in User Task only.

io.camunda.tasklist.exception.TaskListException: Error(message = The field at path ‘/task/taskState’ was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value. The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is ‘TaskState’ within parent type ‘Task’, locations = null, path=[task, taskState], extensions = {classification=NullValueInNonNullableField}, nonStandardFields = null),Error(message = java.lang.NullPointerException: element cannot be mapped to a null key, locations = [Location(line = 1, column = 171)], path=[task, variables], extensions = {type=CompletionException, classification=DataFetchingException}, nonStandardFields = null)

Naveen, I beliece I have encountered the exact problem that you have. Check your “completed” tasks in tasklist - I am willing to bet that your tasks are appearing there.

Are you using pyzeebe? I have found that if you try and do what you describe, write a worker to consume the user task details, no matter what, when that function ends then your user task will be marked completed by pyzeebe → zeebe. Try adding a time.sleep to hold it open and you will see your task appear in tasklist…

My question is, how would I prevent pyzeebe from marking my task as completed?

@eggplant , In Completed tasklist it was not appearing.

I’m using zeebe on Java client, we can change the behaviour of auto complete by setting auto complete to false.

I was able to fix the issue of disappearing of tasks in tasklist by adding timeout parameter for Job Worker.

@JobWorker( type = “io.camunda.zeebe:userTask”, autoComplete = false, timeout = 2592000000L)