{"record":{"id":"a9e985566dcce76b","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymenti-a9e985","errorCode":null,"errorMessage":"Could not find a deployment with id '${deploymentId}'.","messagePattern":"Could not find a deployment 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/BaseDeploymentResourceDataResource.java","lineNumber":57,"sourceCode":"    @Autowired\n    protected EventRepositoryService repositoryService;\n    \n    @Autowired(required=false)\n    protected EventRegistryRestApiInterceptor restApiInterceptor;\n\n    protected byte[] getDeploymentResourceData(String deploymentId, String resourceName, HttpServletResponse response) {\n\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"No deployment id provided\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"No resource name provided\");\n        }\n\n        // Check if deployment exists\n        EventDeployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + deploymentId + \"'.\", EventDeployment.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceName)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n            response.setContentType(contentType);\n            \n            try (final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceName)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseDeploymentResourceDataResource.java#L39-L75","documentation":"FlowableObjectNotFoundException thrown when no EventDeployment exists for the supplied deployment id. The id is syntactically present but does not correspond to any deployment in the event registry repository.","triggerScenarios":"GET .../deployments/{deploymentId}/resources/{resourceName} with an id that was never deployed, was deleted, or belongs to a different database/schema.","commonSituations":"Referencing ids from another Flowable app (process vs event registry tables), stale ids after redeployment cleanup, pointing at a different database in test vs prod, or truncated/copy-pasted ids.","solutions":["Verify the id via GET /event-registry-repository/deployments and use an id from that list.","Check the event registry engine is pointed at the database where the deployment was made (compare datasource config).","Re-deploy the event definitions if the deployment was deleted by the deployment cleanup job."],"exampleFix":"// before\nString id = oldConfig.get(\"deploymentId\"); // stale id from a wiped test DB\n// after\nString id = deploymentList.stream().filter(d -> d.getName().equals(\"events\")).findFirst().get().getId();","handlingStrategy":"try-catch","validationCode":"boolean exists = repositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;","typeGuard":null,"tryCatchPattern":"try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).body(e.getMessage()); }","preventionTips":["Refresh deployment ids after every redeploy/cleanup cycle","Keep one source of truth for ids per environment"],"tags":["rest-api","not-found","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-18T11:17:12.947Z"}