The issue probable lies within the process design, but I am not able to track the real cause.
We have two services, one dataservice and one service with the workflows extension.
The dataservice works fine, and can connect to the workflow-service without authentication. The workflow-service is able to connect to the dataservice via certificate, which also works.
The workflow service has the following dependencies
<dependency>
<groupId>com.mgmtp.a12.workflows</groupId>
<artifactId>workflows-shared</artifactId>
<version>${mgm.a12.workflows.version}</version>
<exclusions>
<exclusion>
<groupId>com.mgmtp.a12.uaa</groupId>
<artifactId>uaa-authentication</artifactId>
</exclusion>
<exclusion>
<groupId>com.mgmtp.a12.uaa</groupId>
<artifactId>uaa-authentication-user-extension</artifactId>
</exclusion>
<exclusion>
<groupId>com.mgmtp.a12.uaa</groupId>
<artifactId>uaa-authentication-user-extension-spring-boot-autoconfigure</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.mgmtp.a12.uaa</groupId>
<artifactId>uaa-rest-client</artifactId>
</dependency>
<dependency>
<groupId>com.mgmtp.a12.uaa</groupId>
<artifactId>uaa-rest-client-spring-boot-autoconfigure</artifactId>
</dependency>
also camunda etc.
We have a process which is started by the dataservice (works) and goes trhough a few steps:
- Service Task - syncAvailableFieldsDelegate
- User Task with a form and a assignement task listener as a Delegate which deletes the metadata of the same task and completes the task. We use this, as far as I understood, to get a document, which we can further modify, before a new user task gets created.
- Service Task - setDocumentFieldDelegate
- … other steps
task listener:
@Slf4j
@Component
@RequiredArgsConstructor
public class AutoCompleteTaskListener implements TaskListener {
private final DataServicesRpcFacade dataServicesRpcFacade;
@Override
public void notify(DelegateTask delegateTask) {
log.info("AutoCompleteListener.onTaskCreate for task {} was triggered", delegateTask.getTaskDefinitionKey());
Object newDocRef = delegateTask.getVariable("newDocRef");
dataServicesRpcFacade.tryRemoveMetadata(new DocumentReference(newDocRef.toString()));
delegateTask.complete();
}
}
With the previous UAA integration (Roles etc, all which we use to secure the dataservice) this works fine, without it, after removing uaa-authentication etc. this throws me an error “task is null”
The error does get thrown when I try to delete the metadata, via tryToRemoveMetadata. I observed the following log message:
2025-10-30 15:40:50.321 [ ] INFO [service-camunda,69038700511a897af8104c9067a7ae55,f8104c9067a7ae55] 1 --- [nio-8120-exec-7] c.t.s.t.i.c.AutoCompleteTaskListener : AutoCompleteListener.onTaskCreate for task fragebogen-erstellen was triggered
2025-10-30T15:40:50.426531179Z 2025-10-30 15:40:50.426 [ ] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] o.s.w.f.CommonsRequestLoggingFilter : Before request [POST /engine-rest/task/cf8abdb4-b5a6-11f0-8798-a6ca915d712f/variables, client=ip_range]
2025-10-30T15:40:50.467658303Z 2025-10-30 15:40:50.467 [ ] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] org.camunda.bpm.engine.cmd : ENGINE-13005 Starting command -------------------- PatchTaskVariablesCmd ----------------------
2025-10-30T15:40:50.468335540Z 2025-10-30 15:40:50.468 [ ] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] org.camunda.bpm.engine.cmd : ENGINE-13009 opening new command context
2025-10-30T15:40:50.468623894Z 2025-10-30 15:40:50.468 [ MYBATIS] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] o.c.b.e.i.p.e.TaskEntity.selectTask : ==> Preparing: select * from ACT_RU_TASK where ID_ = ?
2025-10-30T15:40:50.468709601Z 2025-10-30 15:40:50.468 [ MYBATIS] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] o.c.b.e.i.p.e.TaskEntity.selectTask : ==> Parameters: cf8abdb4-b5a6-11f0-8798-a6ca915d712f(String)
2025-10-30T15:40:50.471215097Z 2025-10-30 15:40:50.471 [ MYBATIS] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] o.c.b.e.i.p.e.TaskEntity.selectTask : <== Total: 0
2025-10-30T15:40:50.471513897Z 2025-10-30 15:40:50.471 [ ] DEBUG [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] org.camunda.bpm.engine.cmd : ENGINE-13011 closing existing command context
2025-10-30T15:40:50.473754975Z 2025-10-30 15:40:50.472 [ ] ERROR [service-camunda,69038702a45b370510e95cc9503b31f3,10e95cc9503b31f3] 1 --- [nio-8120-exec-8] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: task cf8abdb4-b5a6-11f0-8798-a6ca915d712f doesn't exist: task is null
2025-10-30T15:40:50.473759791Z
2025-10-30T15:40:50.473761581Z org.camunda.bpm.engine.exception.NullValueException: task cf8abdb4-b5a6-11f0-8798-a6ca915d712f doesn't exist: task is null
2025-10-30T15:40:50.473763340Z at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2025-10-30T15:40:50.473765099Z at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
2025-10-30T15:40:50.473766817Z at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2025-10-30T15:40:50.473768561Z at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
2025-10-30T15:40:50.473770380Z at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
2025-10-30T15:40:50.473772084Z at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:398)
2025-10-30T15:40:50.473773841Z at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:55)
2025-10-30T15:40:50.473782039Z at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:50)
With A12 UAA I only get the DB request which still returns 0 but doesn’t throw an error, but I do not get the patch, at least not there.
We don’t use any async before or after checks, but when I change my process and introduce these transaction barriers, the error stays.
When I change the tasklistener from assignee to timeout with onme second timeout, the error vanishes but the data is still not right and the process dies a moment later with a different Exception.
My guess is, that we found a race condition in our process, which previously was covered through something from UAA, but now isn’t.
Any ideas?