{"record":{"id":"e91474efed3ac91f","repo":"flowable/flowable-engine","slug":"exception-during-timer-job-acquisition-for-engine","errorCode":null,"errorMessage":"exception during timer job acquisition for engine {}. Exception message: {}","messagePattern":"exception during timer job acquisition for engine (.+?)\\. Exception message: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/asyncexecutor/AcquireTimerJobsRunnable.java","lineNumber":213,"sourceCode":"\n                if (globalAcquireLockEnabled) {\n                    // Always wait when running with global acquire lock, to let other nodes have the ability to fill the queue\n                    // If 0 was returned, it means there is still work to do, but we want to give other nodes a chance.\n                    millisToWait = configuration.getLockPollRate().toMillis();\n\n                } else {\n                    // Otherwise (no global acquire lock),the node can retry immediately\n                    millisToWait = 0;\n\n                }\n\n            }\n\n        } catch (FlowableOptimisticLockingException optimisticLockingException) {\n            logOptimisticLockingException(optimisticLockingException);\n\n        } catch (Throwable e) {\n            LOGGER.warn(\"exception during timer job acquisition for engine {}. Exception message: {}\", getEngineName(), e.getMessage(), e);\n            millisToWait = asyncExecutor.getDefaultTimerJobAcquireWaitTimeInMillis();\n\n        }\n\n        lifecycleListener.stopAcquiring(getEngineName());\n\n        return millisToWait;\n    }\n\n    protected void executeMoveTimerJobsToExecutableJobs(List<TimerJobEntity> timerJobs) {\n        try {\n            if (configuration.isGlobalAcquireLockEnabled()) {\n                commandExecutor.execute(new BulkMoveTimerJobsToExecutableJobsCmd(jobManager, timerJobs));\n            } else {\n                commandExecutor.execute(new MoveTimerJobsToExecutableJobsCmd(jobManager, timerJobs));\n            }\n\n        } catch (FlowableOptimisticLockingException optimisticLockingException) {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/asyncexecutor/AcquireTimerJobsRunnable.java#L195-L231","documentation":"Generic WARN log from the timer-job acquisition thread: a Throwable other than FlowableOptimisticLockingException was thrown while acquiring due timer jobs (AcquireTimerJobsCmd). The wait time falls back to the default timer job acquire wait, and the acquisition loop stops/restarts via lifecycleListener.stopAcquiring.","triggerScenarios":"Any non-optimistic-lock exception during timer job acquisition: SQL errors, connection loss, command failures in AcquireTimerJobsCmd, serialization issues reading timer job entities.","commonSituations":"Database failover mid-acquisition; schema drift between engine version and ACT_RU_TIMER_JOB table; corrupted job entities failing to hydrate.","solutions":["Examine the full stack trace logged with this message for the root cause","Check DB connectivity and the ACT_RU_TIMER_JOB table schema for your Flowable version","Re-run Flowable's database upgrade scripts if versions are mismatched","Restart/redeploy the engine if the acquisition thread has stopped acquiring"],"exampleFix":"// before: schema mismatch after upgrading the jar without migrating DB\n// after: run the upgrade\n// mvn flowable:upgrade or execute org.flowable.db.upgrade scripts for your version","handlingStrategy":"try-catch","validationCode":"// schema sanity check on startup\nSELECT COUNT(*) FROM ACT_RU_TIMER_JOB; -- must not throw SQLException","typeGuard":null,"tryCatchPattern":"try {\n    timerJobs = commandExecutor.execute(new AcquireTimerJobsCmd(cfg));\n} catch (Throwable e) {\n    log.warn(\"timer acquisition failed; backing off\", e);\n    Thread.sleep(defaultWaitMillis);\n}","preventionTips":["Run DB upgrade scripts when upgrading Flowable","Watch DB health during failovers","Alert on repeated 'exception during timer job acquisition' logs"],"tags":["flowable","timer-jobs","job-acquisition","database","async-executor"],"backgroundTag":"database-query-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}