{"record":{"id":"303ad2e10d2b7c54","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymenti","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-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseDeploymentResource.java","lineNumber":37,"sourceCode":"import org.flowable.common.engine.api.FlowableObjectNotFoundException;\nimport org.springframework.beans.factory.annotation.Autowired;\n\n/**\n * @author Tijs Rademakers\n */\npublic class BaseDeploymentResource {\n\n    @Autowired\n    protected CmmnRepositoryService repositoryService;\n    \n    @Autowired(required=false)\n    protected CmmnRestApiInterceptor restApiInterceptor;\n\n    protected CmmnDeployment getCmmnDeployment(String deploymentId) {\n        CmmnDeployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\n\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + deploymentId + \"'.\", CmmnDeployment.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n        \n        return deployment;\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":47,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseDeploymentResource.java#L19-L47","documentation":"BaseDeploymentResource.getCmmnDeployment queries for a CMMN deployment by id (repositoryService.createDeploymentQuery().deploymentId(id).singleResult()). If no deployment matches, it throws FlowableObjectNotFoundException for CmmnDeployment.class, which maps to HTTP 404. If found, the optional restApiInterceptor may still veto access.","triggerScenarios":"REST calls that take a deploymentId path variable (e.g. GET /cmmn-repository/deployments/{deploymentId}, its resources sub-endpoints) when the id does not correspond to an existing deployment.","commonSituations":"Using a stale id after the deployment was deleted (POST /cmmn-repository/deployments/{id} with cascade deletes it); hard-coded ids from another environment; confusing a deployment id with a deployment resource id or definition id.","solutions":["List deployments via GET /cmmn-repository/deployments and use an existing id.","Re-deploy the CMMN model if the deployment was deleted in this environment.","Confirm the environment/database the REST API points to matches where the deployment was made."],"exampleFix":"// before\nGET /cmmn-repository/deployments/deploy-123   // deleted\n// after\nGET /cmmn-repository/deployments              // discover current id\nGET /cmmn-repository/deployments/9f01a3c4-...","handlingStrategy":"try-catch","validationCode":"const deps = await get('/cmmn-repository/deployments');\nif (!deps.data.some(d => d.id === deploymentId)) throw new Error(`Unknown deployment: ${deploymentId}`);","typeGuard":null,"tryCatchPattern":"try {\n  return await getDeployment(id);\n} catch (e) {\n  if (e.response?.status === 404) {\n    const list = await get('/cmmn-repository/deployments');\n    throw new Error(`Deployment ${id} not found. Available: ${list.data.map(d => d.id)}`);\n  }\n  throw e;\n}","preventionTips":["Fetch deployment ids dynamically rather than persisting them across environments.","Re-list deployments after cleanup jobs or cascade deletes.","Distinguish deployment id from resource/definition ids in client code."],"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"}