{"record":{"id":"5b50cf8029c24790","repo":"flowable/flowable-engine","slug":"could-not-find-a-channel-definition-with-id-cha","errorCode":null,"errorMessage":"Could not find a channel definition with id '${channelDefinitionId}'.","messagePattern":"Could not find a channel definition with id '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseEventDefinitionResource.java","lineNumber":62,"sourceCode":"        if (eventDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an event definition with id '\" + eventDefinitionId + \"'.\", EventDefinition.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessEventDefinitionById(eventDefinition);\n        }\n        \n        return eventDefinition;\n    }\n    \n    /**\n     * Returns the {@link ChannelDefinition} that is requested. Throws the right exceptions when bad request was made or definition was not found.\n     */\n    protected ChannelDefinition getChannelDefinitionFromRequest(String channelDefinitionId) {\n        ChannelDefinition channelDefinition = repositoryService.getChannelDefinition(channelDefinitionId);\n\n        if (channelDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a channel definition with id '\" + channelDefinitionId + \"'.\", ChannelDefinition.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessChannelDefinitionById(channelDefinition);\n        }\n        \n        return channelDefinition;\n    }\n}\n","sourceCodeStart":44,"sourceCodeEnd":72,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseEventDefinitionResource.java#L44-L72","documentation":"FlowableObjectNotFoundException thrown by BaseEventDefinitionResource.getChannelDefinitionFromRequest when repositoryService.getChannelDefinition(id) returns null. The channel definition id does not exist in the event registry repository.","triggerScenarios":"GET /event-registry-repository/repository/channel-definitions/{channelDefinitionId} with an id that was never deployed or has been removed.","commonSituations":"Confusing channel definition ids with event definition ids, stale references after redeployment, or pointing at an environment where the channel was never deployed.","solutions":["List channel definitions via GET /event-registry-repository/repository/channel-definitions and use a returned id.","Verify the id comes from the event registry engine, not another Flowable engine.","Redeploy the channel model if the definition was removed by cleanup."],"exampleFix":"// before\nChannelDefinition cd = repoService.getChannelDefinition(\"chan-99\");\n// after\nChannelDefinition cd = repoService.createChannelDefinitionQuery().channelDefinitionKey(\"orderChannel\").latestVersion().singleResult();","handlingStrategy":"try-catch","validationCode":"boolean exists = repositoryService.createChannelDefinitionQuery().channelDefinitionId(id).count() > 0;","typeGuard":null,"tryCatchPattern":"try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).build(); }","preventionTips":["Resolve channel ids by key from the current deployment version","Verify environment-specific databases before hardcoding ids"],"tags":["rest-api","not-found","channel-definition"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:17:23.245Z"}