Automatic History Cleaning Issue

Dear Flowable team

We’ve enabled Automatic History Cleaning in our process manager Flowable 6.6 version by setting following parameters:
flowable.enable-history-cleaning=true
flowable.history-cleaning-after-days=360
flowable.history-cleaning-cycle=0 0 1 * * ?

The cleanup job throws exception below.
Could you please advice what might be the issue
Thanks
Danar

2021-01-25 08:54:01.004 ERROR common.engine.impl.interceptor.CommandContext: Error while closing command context {|||| - ||}
java.lang.NullPointerException: null
at org.flowable.engine.impl.cmd.DeleteRelatedDataOfRemovedHistoricProcessInstancesCmd.execute(DeleteRelatedDataOfRemovedHistoricProcessInstancesCmd.java:33)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:59)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:107)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:81)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:64)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.engine.impl.HistoricProcessInstanceQueryImpl.deleteWithRelatedData(HistoricProcessInstanceQueryImpl.java:876)
at org.flowable.engine.impl.jobexecutor.BpmnHistoryCleanupJobHandler.execute(BpmnHistoryCleanupJobHandler.java:35)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeJobHandler(DefaultJobManager.java:542)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeTimerJob(DefaultJobManager.java:507)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.execute(DefaultJobManager.java:310)
at org.flowable.job.service.impl.cmd.ExecuteAsyncRunnableJobCmd.execute(ExecuteAsyncRunnableJobCmd.java:85)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable$2.execute(ExecuteAsyncRunnable.java:130)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable$2.execute(ExecuteAsyncRunnable.java:127)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:59)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:107)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:81)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:64)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:127)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-01-25 08:54:01.007 ERROR common.engine.impl.interceptor.CommandContext: Error while closing command context {|||| - ||}
java.lang.NullPointerException: null
at org.flowable.engine.impl.cmd.DeleteRelatedDataOfRemovedHistoricProcessInstancesCmd.execute(DeleteRelatedDataOfRemovedHistoricProcessInstancesCmd.java:33)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:59)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:107)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:81)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:64)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.engine.impl.HistoricProcessInstanceQueryImpl.deleteWithRelatedData(HistoricProcessInstanceQueryImpl.java:876)
at org.flowable.engine.impl.jobexecutor.BpmnHistoryCleanupJobHandler.execute(BpmnHistoryCleanupJobHandler.java:35)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeJobHandler(DefaultJobManager.java:542)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeTimerJob(DefaultJobManager.java:507)
at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.execute(DefaultJobManager.java:310)
at org.flowable.job.service.impl.cmd.ExecuteAsyncRunnableJobCmd.execute(ExecuteAsyncRunnableJobCmd.java:85)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable$2.execute(ExecuteAsyncRunnable.java:130)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable$2.execute(ExecuteAsyncRunnable.java:127)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:59)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:107)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:81)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:64)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:127)
at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

That’s a strange place for an NPE: flowable-engine/DeleteRelatedDataOfRemovedHistoricProcessInstancesCmd.java at master · flowable/flowable-engine · GitHub

It should have failed before if the processEngineConfiguration is null. Are you sure you’re running 6.6.0 as-is?

Hi Joram
Thanks for your feedback!
Yes, we’re using 6.6.0 which has been released in October 2020.

But I see in this commit (fix: check if identity links enabled before attempting to get histori… · flowable/flowable-engine@b9c8958 · GitHub
) there was a fix which has been applied on this issue in November
So my question is there any maintenance release out of this commit? Because October release doesn’t contain this fix.

Thanks
Danar

We have the exact same problem. Flowable 6.6.0 is installed, automatic history cleaning is enabled in the spring boot properties. Enabling it did delete all the required process instances, but caused this error. Looking forward to see any suggestions on how to fix that.

Exact same error for us.
Using 6.6.0 as-is with Spring Boot 2.3
Thanks.