flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find a deployment with id ''.
Error message
Could not find a deployment with id ''.
What it means
FlowableObjectNotFoundException thrown by AppDeploymentManager.removeDeployment when no deployment with the given id exists in the app engine. The delete operation is refused because there is nothing to undeploy.
Source
Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/deployer/AppDeploymentManager.java:130
deployment.setNew(false);
deploy(deployment, null);
cachedAppDefinition = deployment.getAppDefinitionCacheEntry(appDefinitionId);
if (cachedAppDefinition == null) {
throw new FlowableException("deployment '" + deploymentId + "' didn't put app definition '" + appDefinitionId + "' in the cache");
}
}
return cachedAppDefinition;
}
public void removeDeployment(String deploymentId) {
removeDeployment(deploymentId, true);
}
public void removeDeployment(String deploymentId, boolean cascade) {
AppDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId);
if (deployment == null) {
throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", AppDeploymentEntity.class);
}
List<EngineDeployer> engineUnDeployers = new ArrayList<>(deployers);
engineUnDeployers.sort(Comparator.comparingInt(EngineDeployer::getUndeployOrder));
for (EngineDeployer deployer : engineUnDeployers) {
deployer.undeploy(deployment, cascade);
}
FlowableEventDispatcher eventDispatcher = appEngineConfiguration.getEventDispatcher();
for (AppDefinition appDefinition : new AppDefinitionQueryImpl().deploymentId(deploymentId).list()) {
appDefinitionCache.remove(appDefinition.getId());
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
eventDispatcher.dispatchEvent(new FlowableEntityEventImpl(appDefinition, FlowableEngineEventType.DEFINITION_UNDEPLOYED),
appEngineConfiguration.getEngineCfgKey());
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Check the id exists first via repositoryService.createDeploymentQuery().deploymentId(id).singleResult()
- Ensure you use an app-engine deployment id (ACT_APP_DEPLOYMENT), not a process deployment id
- Skip the delete if the deployment is already gone (idempotent handling)
- Point the engine configuration at the database that actually holds the deployment
Example fix
// before
repoService.deleteDeployment(deploymentId);
// after
if (repoService.createDeploymentQuery().deploymentId(deploymentId).count() > 0) {
repoService.deleteDeployment(deploymentId);
} Defensive patterns
Strategy: validation
Validate before calling
if (repoService.createDeploymentQuery().deploymentId(deploymentId).count() == 0) {
return; // already deleted or wrong id
}
repoService.deleteDeployment(deploymentId); Prevention
- Track deletion state to keep deletes idempotent
- Confirm id source table (app engine, not process engine)
- Catch FlowableObjectNotFoundException and treat as already-deleted
When it happens
Trigger: Calling repositoryService.deleteDeployment(deploymentId) (with or without cascade) using an id that was already deleted, never existed, or belongs to a different engine's table prefix.
Common situations: Double-delete after an earlier cleanup script ran; deleting by a process/deployment id from flowable-engine instead of the app-engine deployment id; environment mismatch (dev id used against test DB); database recreated between steps.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Could not find a deployment with id '" + deploymentId + "'.
- Could not find a resource with id '<resourceName>' in deploy
- Could not find an app deployment with id '<deploymentId>
- no apps deployed with key = '' and version = ''
- Could not find deployment with id ${deploymentId}
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0e0b1d59db17c9a7.
Report an issue: GitHub.