{"record":{"id":"3dc158f80dea9fae","repo":"flowable/flowable-engine","slug":"deployment-deploymentid-didn-t-put-event-defi","errorCode":null,"errorMessage":"deployment '${deploymentId}' didn't put event definition '${eventDefinitionId}' in the cache","messagePattern":"deployment '(.+?)' didn't put event definition '(.+?)' in the cache","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java","lineNumber":191,"sourceCode":"    public EventDefinitionCacheEntry resolveEventDefinition(EventDefinition eventDefinition) {\n        String eventDefinitionId = eventDefinition.getId();\n        String deploymentId = eventDefinition.getDeploymentId();\n\n        EventDefinitionCacheEntry cachedEventDefinition = eventDefinitionCache.get(eventDefinitionId);\n\n        if (cachedEventDefinition == null) {\n            EventDeploymentEntity deployment = engineConfig.getDeploymentEntityManager().findById(deploymentId);\n            List<EventResourceEntity> resources = engineConfig.getResourceEntityManager().findResourcesByDeploymentId(deploymentId);\n            for (EventResourceEntity resource : resources) {\n                deployment.addResource(resource);\n            }\n\n            deployment.setNew(false);\n            deploy(deployment);\n            cachedEventDefinition = eventDefinitionCache.get(eventDefinitionId);\n\n            if (cachedEventDefinition == null) {\n                throw new FlowableException(\"deployment '\" + deploymentId + \"' didn't put event definition '\" + eventDefinitionId + \"' in the cache\");\n            }\n        }\n        return cachedEventDefinition;\n    }\n    \n    /**\n     * Resolving the channel will fetch the channel definition, parse it and store the {@link ChannelDefinition} in memory.\n     */\n    public ChannelDefinitionCacheEntry resolveChannelDefinition(ChannelDefinition channelDefinition) {\n        String channelDefinitionId = channelDefinition.getId();\n        String deploymentId = channelDefinition.getDeploymentId();\n\n        ChannelDefinitionCacheEntry cachedChannelDefinition = channelDefinitionCache.get(channelDefinitionId);\n\n        if (cachedChannelDefinition == null) {\n            EventDeploymentEntity deployment = engineConfig.getDeploymentEntityManager().findById(deploymentId);\n            List<EventResourceEntity> resources = engineConfig.getResourceEntityManager().findResourcesByDeploymentId(deploymentId);\n            for (EventResourceEntity resource : resources) {","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java#L173-L209","documentation":"FlowableException raised in resolveEventDefinition after re-deploying a deployment from disk into an empty cache: the deploy() completed but the cache still holds no entry for the requested eventDefinitionId. This indicates the deployment's persisted resources did not produce that definition id — an internal consistency problem between the database metadata and the deployed model resources.","triggerScenarios":"Requesting an EventDefinitionEntity whose id exists in the definition table but whose parent deployment, when redeployed lazily, fails to register that definition id into eventDefinitionCache — e.g. resource missing from the deployment store or a deployer silently skipping the resource.","commonSituations":"Manually edited or partially migrated FLW_EV_ tables; deployment resources deleted while definition rows remain; custom deployers not registering definitions; corrupted deployment after a failed upgrade.","solutions":["Check the deployment's resources (getDeployment(d).getResources()) to confirm the event model file backing this definition id is present.","Delete the broken deployment and redeploy the event model cleanly so definitions and resources stay consistent.","Clear/inspect the event definition cache configuration; ensure a deployer actually parses and registers the definition.","If data was migrated, verify definition rows reference resources belonging to the same deployment."],"exampleFix":"// before\nEventDefinitionEntity def = eventDeploymentManager.findDeployedEventDefinitionById(badDefinitionId);\n// after\nEventDefinition def = eventRepositoryService.createEventDefinitionQuery().deploymentId(deploymentId).list()\n    .stream().filter(d -> d.getId().equals(definitionId)).findFirst()\n    .orElseThrow(() -> new IllegalStateException(\"definition not in deployment, redeploy needed\"));","handlingStrategy":"fallback","validationCode":"EventDefinition def = eventRepositoryService.createEventDefinitionQuery().deploymentId(deploymentId).list()\n    .stream().filter(d -> d.getId().equals(definitionId)).findFirst().orElse(null);\nif (def == null) throw new IllegalStateException(\"definition \" + definitionId + \" missing from deployment \" + deploymentId);","typeGuard":null,"tryCatchPattern":"try {\n    entity = manager.findDeployedEventDefinitionById(definitionId);\n} catch (FlowableException e) {\n    // redeploy the deployment or fail fast; this indicates data inconsistency\n    throw new IllegalStateException(\"inconsistent deployment data for \" + definitionId, e);\n}","preventionTips":["Never modify FLW_EV_ tables manually; keep definitions and resources in sync.","Verify deployments complete successfully before relying on their definitions.","Avoid custom deployers unless they register cache entries like the default ones.","Monitor for failed upgrades/migrations that can orphan definition rows."],"tags":["flowable","event-registry","cache","internal"],"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-14T11:17:12.474Z"}