{"record":{"id":"5010e238aa10fb8f","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymenti-5010e2","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/DeploymentResourceResource.java","lineNumber":79,"sourceCode":"     * @ApiImplicitParam(name = \"resourceId\", dataType = \"string\", value =\n     * \"The id of the resource to get. Make sure you URL-encode the resourceId in case it contains forward slashes. Eg: use diagrams%2Fmy-process.bpmn20.xml instead of diagrams/Fmy-process.bpmn20.xml.\"\n     * , paramType = \"path\") })\n     */\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates both deployment and resource have been found and the resource has been returned.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested deployment was not found or there is no resource with the given id present in the deployment. The status-description contains additional information.\")\n    })\n    @GetMapping(value = \"/repository/deployments/{deploymentId}/resources/**\", produces = \"application/json\")\n    public DeploymentResourceResponse getDeploymentResource(@ApiParam(name = \"deploymentId\") @PathVariable(\"deploymentId\") String deploymentId, HttpServletRequest request) {\n        // The ** is needed because the name of the resource can actually contain forward slashes.\n        // For example org/flowable/model.bpmn2. The number of forward slashes is unknown.\n        // Using ** means that everything should get matched.\n        // See also https://stackoverflow.com/questions/31421061/how-to-handle-requests-that-includes-forward-slashes/42403361#42403361\n\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 + \"'.\");\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        String pathInfo = request.getPathInfo();\n        String resourceName = pathInfo.replace(\"/repository/deployments/\" + deploymentId + \"/resources/\", \"\");\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceName)) {\n            // Build resource representation\n            DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName, contentTypeResolver.resolveContentType(resourceName));\n            return response;\n\n        } else {\n            // Resource not found in deployment","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/DeploymentResourceResource.java#L61-L97","documentation":"FlowableObjectNotFoundException thrown by getDeploymentResource when the deployment identified by deploymentId does not exist (query returns null). Note this variant omits the resource class in the constructor. Mapped to HTTP 404 by the REST exception handler.","triggerScenarios":"GET /repository/deployments/{deploymentId}/resources/{resourceName} where deploymentId does not match any deployment (checked before looking up the resource itself).","commonSituations":"Resource path containing forward slashes confusing the URL mapping so the wrong segment is captured as deploymentId, stale deployment id, wrong engine/database.","solutions":["Confirm the deploymentId from GET /repository/deployments before requesting a resource","URL-encode the resource name when it contains '/' (the endpoint uses ** matching)","Check that the deployment still exists (not cleaned up) on the target engine","Verify you are hitting the right REST context path and engine"],"exampleFix":"// before\nGET /repository/deployments/1/resources/my/folder/process.bpmn20.xml  // unencoded\n// after\nGET /repository/deployments/1/resources/my%2Ffolder%2Fprocess.bpmn20.xml","handlingStrategy":"validation","validationCode":"const resources = (await rest.get(`/repository/deployments/${deploymentId}/resources`)).data;\nif (!resources.length) throw new Error('Deployment has no resources or does not exist');","typeGuard":null,"tryCatchPattern":"try {\n    await rest.get(`/repository/deployments/${deploymentId}/resources/${encodeURIComponent(name)}`);\n} catch (e) {\n    if (e.response?.status === 404) {\n        // distinguish: bad deploymentId vs bad resourceName by listing first\n    }\n}","preventionTips":["URL-encode resource names containing slashes","Validate the deploymentId against the deployments list before resource calls","Use the REST context path and engine you deployed to"],"tags":["deployment","resource","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"}