{"record":{"id":"7ecc311f4242be0a","repo":"flowable/flowable-engine","slug":"deployment-didn-t-put-app-definition-in-the","errorCode":null,"errorMessage":"deployment '' didn't put app definition '' in the cache","messagePattern":"deployment '' didn't put app definition '' in the cache","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/deployer/AppDeploymentManager.java","lineNumber":117,"sourceCode":"        }\n        appDefinition = resolveAppDefinition(appDefinition).getAppDefinition();\n        return appDefinition;\n    }\n\n    public AppDefinitionCacheEntry resolveAppDefinition(AppDefinition appDefinition) {\n        String appDefinitionId = appDefinition.getId();\n        String deploymentId = appDefinition.getDeploymentId();\n\n        AppDefinitionCacheEntry cachedAppDefinition = appDefinitionCache.get(appDefinitionId);\n\n        if (cachedAppDefinition == null) {\n            AppDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId);\n            deployment.setNew(false);\n            deploy(deployment, null);\n            cachedAppDefinition = deployment.getAppDefinitionCacheEntry(appDefinitionId);\n\n            if (cachedAppDefinition == null) {\n                throw new FlowableException(\"deployment '\" + deploymentId + \"' didn't put app definition '\" + appDefinitionId + \"' in the cache\");\n            }\n        }\n        return cachedAppDefinition;\n    }\n    \n    public void removeDeployment(String deploymentId) {\n        removeDeployment(deploymentId, true);\n    }\n    \n    public void removeDeployment(String deploymentId, boolean cascade) {\n        AppDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId);\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + deploymentId + \"'.\", AppDeploymentEntity.class);\n        }\n        \n        List<EngineDeployer> engineUnDeployers = new ArrayList<>(deployers);\n        engineUnDeployers.sort(Comparator.comparingInt(EngineDeployer::getUndeployOrder));\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/deployer/AppDeploymentManager.java#L99-L135","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Verify you are passing an app definition id, not a deployment id","Re-deploy the original app archive to rebuild consistent deployment records","Inspect ACT_APP_DEPLOYMENT and ACT_APP_APPDEF rows for the id; clean up orphaned records","If reproducible, file/check for a Flowable bug in AppDeploymentManager.resolveAppDefinition"],"exampleFix":"// before\nAppDefinition def = repoService.getAppDefinition(appDefinitionId); // id copied from wrong table\n// after\nAppDefinition def = repoService.createAppDefinitionQuery().appDefinitionId(correctAppDefId).singleResult();","handlingStrategy":"try-catch","validationCode":"AppDefinition check = repoService.createAppDefinitionQuery().appDefinitionId(appDefinitionId).singleResult();\nif (check == null) throw new IllegalStateException(\"Unknown app definition id: \" + appDefinitionId);","typeGuard":null,"tryCatchPattern":"try {\n    AppDefinition def = repoService.getAppDefinition(appDefinitionId);\n} catch (FlowableException e) {\n    // treat as corrupted deployment: re-deploy archive or surface an internal error\n}","preventionTips":["Never manipulate ACT_APP tables manually","Always deploy via the repository service so deployment and app definition rows stay consistent","Verify ids with a query before resolution"],"tags":["flowable","cache","inconsistent-state","app-definition"],"backgroundTag":"internal-invariant-violation","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"}