{"record":{"id":"80fa48ba5e3bb2e4","repo":"flowable/flowable-engine","slug":"no-channel-definition-found-for-key-for-parent","errorCode":null,"errorMessage":"No channel definition found for key '' for parent deployment id ","messagePattern":"No channel definition found for key '' for parent deployment id ","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetChannelModelCmd.java","lineNumber":111,"sourceCode":"            if (channelDefinitionEntity == null) {\n                throw new FlowableObjectNotFoundException(\"No channel definition found for key '\" + channelDefinitionKey + \"' for tenant identifier \" + tenantId, ChannelDefinitionEntity.class);\n            }\n\n        } else if (channelDefinitionKey != null && (tenantId == null || EventRegistryEngineConfiguration.NO_TENANT_ID.equals(tenantId)) && parentDeploymentId != null) {\n\n            List<EventDeployment> eventDeployments = deploymentManager.getDeploymentEntityManager().findDeploymentsByQueryCriteria(\n                            new EventDeploymentQueryImpl().parentDeploymentId(parentDeploymentId));\n            \n            if (eventDeployments != null && eventDeployments.size() > 0) {\n                channelDefinitionEntity = channelDefinitionEntityManager.findChannelDefinitionByDeploymentAndKey(eventDeployments.get(0).getId(), channelDefinitionKey);\n            }\n            \n            if (channelDefinitionEntity == null) {\n                channelDefinitionEntity = channelDefinitionEntityManager.findLatestChannelDefinitionByKey(channelDefinitionKey);\n            }\n            \n            if (channelDefinitionEntity == null) {\n                throw new FlowableObjectNotFoundException(\"No channel definition found for key '\" + channelDefinitionKey +\n                        \"' for parent deployment id \" + parentDeploymentId, ChannelDefinitionEntity.class);\n            }\n\n        } else if (channelDefinitionKey != null && tenantId != null && !EventRegistryEngineConfiguration.NO_TENANT_ID.equals(tenantId) && parentDeploymentId != null) {\n\n            List<EventDeployment> eventDeployments = deploymentManager.getDeploymentEntityManager().findDeploymentsByQueryCriteria(\n                            new EventDeploymentQueryImpl().parentDeploymentId(parentDeploymentId).deploymentTenantId(tenantId));\n            \n            if (eventDeployments != null && eventDeployments.size() > 0) {\n                channelDefinitionEntity = channelDefinitionEntityManager.findChannelDefinitionByDeploymentAndKeyAndTenantId(\n                                eventDeployments.get(0).getId(), channelDefinitionKey, tenantId);\n            }\n            \n            if (channelDefinitionEntity == null) {\n                channelDefinitionEntity = channelDefinitionEntityManager.findLatestChannelDefinitionByKeyAndTenantId(channelDefinitionKey, tenantId);\n            }\n            \n            if (channelDefinitionEntity == null && eventEngineConfiguration.isFallbackToDefaultTenant()) {","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetChannelModelCmd.java#L93-L129","documentation":"Thrown when resolving a channel definition by key within a given parentDeploymentId (no tenant) and neither the parent deployment nor any deployment contains a latest definition for that key. FlowableObjectNotFoundException naming key and parent deployment id.","triggerScenarios":"getChannelModel with channelDefinitionKey + parentDeploymentId (tenantId null) where the parent deployment's channel definitions and the latest fallback both fail to match the key.","commonSituations":"Passing an event-deployment's parent id while the channel belongs to a different deployment; key mismatch within the parent deployment; parent deployment id itself stale/deleted.","solutions":["Verify the parent deployment actually contains a channel definition with that key (query its resources)","Use the correct parentDeploymentId from the deployment that deployed the channel, or drop the parent filter","Check the key spelling against the channel XML <channel id=...>"],"exampleFix":"// before\ngetChannelModel(\"orders\", wrongParentDeploymentId, null);\n// after\nEventDeployment dep = repositoryService.createDeploymentQuery().deploymentName(\"orders-app\").singleResult();\ngetChannelModel(\"orders\", dep.getId(), null);","handlingStrategy":"validation","validationCode":"EventDeployment dep = repositoryService.createDeploymentQuery()\n    .deploymentId(parentDeploymentId).singleResult();\nif (dep == null) throw new IllegalStateException(\"parent deployment \" + parentDeploymentId + \" does not exist\");","typeGuard":null,"tryCatchPattern":"try {\n    return repositoryService.getChannelModel(null, key, null, parentDeploymentId);\n} catch (FlowableObjectNotFoundException e) {\n    LOGGER.error(\"channel {} not in parent deployment {}\", key, parentDeploymentId);\n    throw e;\n}","preventionTips":["Take parentDeploymentId from the deployment that actually deployed the channel","Confirm the channel key exists inside the parent deployment's resources before lookup"],"tags":["flowable","not-found","channel","deployment"],"backgroundTag":"resource-not-found","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"}