{"record":{"id":"069b2ac99d1d2e10","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymenti-069b2a","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-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceCollectionResource.java","lineNumber":66,"sourceCode":"\n    @Autowired\n    protected RepositoryService repositoryService;\n    \n    @Autowired(required=false)\n    protected BpmnRestApiInterceptor restApiInterceptor;\n\n    @ApiOperation(value = \"List resources in a deployment\", tags = { \"Deployment\" }, nickname=\"listDeploymentResources\",\n            notes = \"The dataUrl property in the resulting JSON for a single resource contains the actual URL to use for retrieving the binary resource.\")\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates the deployment was found and the resource list has been returned.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested deployment was not found.\")\n    })\n    @GetMapping(value = \"/repository/deployments/{deploymentId}/resources\", produces = \"application/json\")\n    public List<DeploymentResourceResponse> getDeploymentResources(@ApiParam(name = \"deploymentId\") @PathVariable String deploymentId) {\n        // Check if deployment exists\n        Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + deploymentId + \"'.\", Deployment.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);\n\n        return restResponseFactory.createDeploymentResourceResponseList(deploymentId, resourceList, contentTypeResolver);\n    }\n}\n","sourceCodeStart":48,"sourceCodeEnd":78,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceCollectionResource.java#L48-L78","documentation":"FlowableObjectNotFoundException (Deployment.class) thrown by getDeploymentResources when no deployment exists for the given deploymentId; the endpoint lists a deployment's resources and first verifies the deployment exists. Results in an HTTP 404 response.","triggerScenarios":"GET /repository/deployments/{deploymentId}/resources with an unknown deploymentId.","commonSituations":"Truncated/copy-pasted id, id from a different engine instance, deployment removed between listing and fetching resources, tooling storing names instead of ids.","solutions":["Call GET /repository/deployments to list valid ids and use one from the response","Verify the id is complete and unmodified when copying between tools","Point the client at the correct Flowable instance/database that holds the deployment","Handle 404 gracefully in clients that poll after a deployment cleanup"],"exampleFix":"// before\nGET /repository/deployments/abc/resources  // 'abc' is not a deployment id\n// after\nGET /repository/deployments  -> pick .data[0].id\nGET /repository/deployments/2501/resources","handlingStrategy":"validation","validationCode":"const ids = (await rest.get('/repository/deployments')).data.data.map(d => d.id);\nif (!ids.includes(deploymentId)) throw new Error(`Unknown deployment id ${deploymentId}`);","typeGuard":null,"tryCatchPattern":"try {\n    await rest.get(`/repository/deployments/${deploymentId}/resources`);\n} catch (e) {\n    if (e.response?.status === 404) {\n        // refresh deployment list and pick a valid id\n    }\n}","preventionTips":["Copy ids verbatim from API responses; never retype them","Handle 404 in tooling that runs after deployment cleanup","Check engine/database consistency when ids come from another environment"],"tags":["deployment","resources","not-found","rest"],"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"}