I’m encountering a problem with the execution of one of my business processes in Zeebe Camunda 8.5.0. During execution, a task that is supposed to compute a delay for a timer expires immediately. When inspecting the variables in Camunda Operate, I notice that the timer value is set to “now,” which explains why the timer expires instantly.
However, based on the current implementation, the delay value should be set in the future, not to “now.” In addition, I can’t find any log traces of this job worker being executed, while I do see logs for other tasks that run before and after it.
I tried renaming the main business process, but that didn’t resolve the issue. Interestingly, when I rename the problematic job workers, I do see logs in Kibana indicating that the job worker is executed correctly and the calculated date is as expected.
Renaming job workers every time a problem occurs is not a viable solution for me.
Could you help me understand why this task appears to be executed successfully from Camunda Operate’s perspective, but I don’t see any corresponding logs in my environment? I only have a single Kubernetes cluster, and all logs are routed to Kibana, so I would expect to see logs for this task as well.
Hi, it might be out of topic, but first, I would start by cleaning up your worker code:
Remove Lombok, as it can unexpectedly interfere with other components, such as having an influence on serialization, etc.
Use a very standard way to create a worker, like this example (with implementing JobHandler (I know, when using @JobWorker you do not need it, but it is useful in other scenarios, e.g., where you have to create a utility function that accepts all workers as parameters), and ensure you read and write variables appropriately using autoComplete = false."
@Component
@SuppressWarnings("unused")
public class PersistOneEntityStandardWorker implements JobHandler {
private static final Logger logger = LoggerFactory.getLogger(PersistOneEntityStandardWorker.class);
private final OrchestratorOneService oOneService;
public PersistOneEntityStandardWorker(OrchestratorOneService oOneService) {
this.oOneService = oOneService;
}
@JobWorker(type = "persistOneEntityStandardWorker", autoComplete = false)
public void handle(final JobClient client, final ActivatedJob job) {
ProcessInstanceVariables variables = job.getVariablesAsType(ProcessInstanceVariables.class);
OneEntity oneEntity = new OneEntity(variables.getBusinessCorrelationId().toString(), "body one standard");
OneEntity oneEntityPersisted = oOneService.createOneEntity(oneEntity).block();
variables.setOneEntity(oneEntityPersisted);
client.newCompleteCommand(job.getKey())
.variables(variables)
.send() // .join() would block
.exceptionally(throwable -> {
throw new RuntimeException("Could not complete job " + job, throwable);
});
logger.debug("PersistOneEntity standard way system task {} completed!", job.getKey());
}
}
Maybe this will help to find the reason of the “strange” behavior.