{"record":{"id":"53bdcdb3891f1737","repo":"flowable/flowable-engine","slug":"cannot-unacquire-bpmn-job-there-is-no-bpmn-engine","errorCode":null,"errorMessage":"Cannot unacquire BPMN job. There is no BPMN engine available","messagePattern":"Cannot unacquire BPMN job\\. There is no BPMN engine available","errorType":"exception","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerUnacquireJobResource.java","lineNumber":94,"sourceCode":"            throw new FlowableIllegalArgumentException(\"worker id is required\");\n        }\n\n        ExternalWorkerJob job = getExternalWorkerJobById(jobId);\n\n        if (!workerId.equals(job.getLockOwner())) {\n            throw new FlowableForbiddenException(workerId + \" does not hold a lock on the requested job\");\n        }\n\n        if (job.getProcessInstanceId() != null) {\n            if (managementService != null) {\n                if (restApiInterceptor != null) {\n                    restApiInterceptor.unacquireExternalWorkerJob(job, request);\n                }\n\n                managementService.unacquireExternalWorkerJob(jobId, workerId);\n                \n            } else {\n                throw new FlowableException(\"Cannot unacquire BPMN job. There is no BPMN engine available\");\n            }\n        } else if (ScopeTypes.CMMN.equals(job.getScopeType())) {\n            if (cmmnManagementService != null) {\n                if (restApiInterceptor != null) {\n                    restApiInterceptor.unacquireExternalWorkerJob(job, request);\n                }\n\n                cmmnManagementService.unacquireExternalWorkerJob(jobId, workerId);\n                \n            } else {\n                throw new FlowableException(\"Cannot unacquire CMMN job. There is no CMMN engine available\");\n            }\n            \n        } else {\n            throw new FlowableIllegalArgumentException(\n                    \"Can only unacquire BPMN or CMMN external job. Job with id '\" + jobId + \"' is from scope '\" + job.getScopeType() + \"'\");\n        }\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerUnacquireJobResource.java#L76-L112","documentation":"FlowableException thrown by unaquireJob when the job belongs to the BPMN scope but the BPMN engine's managementService is null. The job was found (likely via CMMN query or the job exists), but the engine service needed to actually release the lock is not available. Indicates a partial/miswired engine configuration.","triggerScenarios":"POST /external-worker-job/unacquire/jobs/{jobId} for a job with scopeType BPMN on a deployment where ProcessEngine managementService is not injected into ExternalWorkerUnacquireJobResource.","commonSituations":"CMMN-only deployment encountering a leftover BPMN job; Spring config disabling the process engine while old BPMN jobs remain in the shared database.","solutions":["Enable/configure the BPMN engine so managementService is available.","If intentionally BPMN-less, clean up stale BPMN external worker jobs from the database.","Verify the correct REST module wiring includes the ProcessEngine services."],"exampleFix":"// before\nflowable:\n  process:\n    enabled: false\n// after\nflowable:\n  process:\n    enabled: true","handlingStrategy":"fallback","validationCode":"boolean canUnacquireBpmn = processEngine != null; // verify before exposing the endpoint to BPMN jobs","typeGuard":null,"tryCatchPattern":"try { unaquireJob(jobId, request); } catch (FlowableException e) { if (e.getMessage().contains(\"no BPMN engine\")) { alertOps(\"BPMN engine not configured\"); } else { throw e; } }","preventionTips":["Run BPMN and REST modules together if BPMN external jobs exist","Clean stale BPMN jobs when running CMMN-only","Add startup checks that engine services are wired"],"tags":["configuration","engine","external-worker","rest-api"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}