{"record":{"id":"52ccdaa3e2464b41","repo":"flowable/flowable-engine","slug":"deployment-does-not-exist-52ccda","errorCode":null,"errorMessage":"deployment does not exist: ","messagePattern":"deployment does not exist: ","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceCmd.java","lineNumber":52,"sourceCode":"\n    public GetDeploymentResourceCmd(String deploymentId, String resourceName) {\n        this.deploymentId = deploymentId;\n        this.resourceName = resourceName;\n    }\n\n    @Override\n    public InputStream execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n\n        EventResourceEntity resource = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);\n        if (resource == null) {\n            if (CommandContextUtil.getDeploymentEntityManager(commandContext).findById(deploymentId) == null) {\n                throw new FlowableObjectNotFoundException(\"deployment does not exist: \" + deploymentId);\n            } else {\n                throw new FlowableObjectNotFoundException(\"no resource found with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'\");\n            }\n        }\n        return new ByteArrayInputStream(resource.getBytes());\n    }\n\n}\n","sourceCodeStart":34,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetDeploymentResourceCmd.java#L34-L61","documentation":"After the null checks, the command queries the resource by deploymentId and resourceName. If no resource row is found AND the deployment itself does not exist, it throws FlowableObjectNotFoundException 'deployment does not exist: <id>'. This distinguishes a bad deployment id from a bad resource name.","triggerScenarios":"Executing GetDeploymentResourceCmd with a deploymentId that was never deployed, was deleted, or belongs to a different engine (e.g. process deployment id used against the event-registry engine).","commonSituations":"Using a BPMN/process deployment id with the event registry service; deployment removed by cascade delete or cleanup job; hard-coded id from another environment (test vs prod database).","solutions":["Verify the id is an EVENT deployment id via EventRepositoryService.createDeploymentQuery().deploymentId(id).singleResult()","Redeploy the event deployment if it was deleted","Point the call at the correct engine/service for the deployment type"],"exampleFix":"// before\nInputStream is = getDeploymentResource(processDeploymentId, \"order.event.json\"); // wrong engine's id\n// after\nEventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentId(eventDeploymentId).singleResult();\nif (dep == null) throw new FlowableObjectNotFoundException(\"Unknown event deployment \" + eventDeploymentId);\nInputStream is = getDeploymentResource(eventDeploymentId, \"order.event.json\");","handlingStrategy":"try-catch","validationCode":"EventDeployment dep = eventRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (dep == null) throw new IllegalArgumentException(\"Unknown event deployment: \" + deploymentId);","typeGuard":"boolean deploymentExists = eventRepositoryService.createDeploymentQuery().deploymentId(id).singleResult() != null;","tryCatchPattern":"try {\n    return getDeploymentResource(deploymentId, resourceName);\n} catch (FlowableObjectNotFoundException e) {\n    if (e.getMessage().startsWith(\"deployment does not exist\")) {\n        throw new IllegalStateException(\"Stale deployment id: \" + deploymentId, e);\n    }\n    throw e;\n}","preventionTips":["Verify deployment existence before resource access","Distinguish event-registry deployment ids from process deployment ids","Handle cascading deletes that remove deployments"],"tags":["flowable","event-registry","not-found","deployment"],"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-14T05:17:10.506Z"}