flowable/flowable-engine · error · FlowableException

deployment '' didn't put app definition '' in the cache

Error message

deployment '' didn't put app definition '' in the cache

What it means

FlowableException thrown by AppDeploymentManager.resolveAppDefinition when, after (re)deploying the deployment found by id, the expected app definition is still absent from the deployment's app-definition cache entry. This indicates the deployment exists but did not produce the requested app definition, an internal consistency failure.

Source

Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/deployer/AppDeploymentManager.java:117

        }
        appDefinition = resolveAppDefinition(appDefinition).getAppDefinition();
        return appDefinition;
    }

    public AppDefinitionCacheEntry resolveAppDefinition(AppDefinition appDefinition) {
        String appDefinitionId = appDefinition.getId();
        String deploymentId = appDefinition.getDeploymentId();

        AppDefinitionCacheEntry cachedAppDefinition = appDefinitionCache.get(appDefinitionId);

        if (cachedAppDefinition == null) {
            AppDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId);
            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));

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify you are passing an app definition id, not a deployment id
  2. Re-deploy the original app archive to rebuild consistent deployment records
  3. Inspect ACT_APP_DEPLOYMENT and ACT_APP_APPDEF rows for the id; clean up orphaned records
  4. If reproducible, file/check for a Flowable bug in AppDeploymentManager.resolveAppDefinition

Example fix

// before
AppDefinition def = repoService.getAppDefinition(appDefinitionId); // id copied from wrong table
// after
AppDefinition def = repoService.createAppDefinitionQuery().appDefinitionId(correctAppDefId).singleResult();
Defensive patterns

Strategy: try-catch

Validate before calling

AppDefinition check = repoService.createAppDefinitionQuery().appDefinitionId(appDefinitionId).singleResult();
if (check == null) throw new IllegalStateException("Unknown app definition id: " + appDefinitionId);

Try / catch

try {
    AppDefinition def = repoService.getAppDefinition(appDefinitionId);
} catch (FlowableException e) {
    // treat as corrupted deployment: re-deploy archive or surface an internal error
}

Prevention

When it happens

Trigger: Calling findDeployedAppDefinitionById (directly or via getAppDefinition(appDefinitionId)) with an app definition id whose parent deployment, when re-deployed, does not register an app definition with that id — e.g. a corrupted/partial deployment record or mismatched ids.

Common situations: Manually edited or partially migrated ACT_APP tables; deployment row present but its app resource failed to parse during re-deploy; copying rows between environments; passing a wrong id (e.g. a deployment id instead of an app definition id).

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/7ecc311f4242be0a. Report an issue: GitHub.